From 63421aeeec7481a293756eebe8fba483184bae61 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Tue, 26 Mar 2024 23:36:58 +0530 Subject: [PATCH] icon fix, opening fix --- src/js/control-view.js | 8 ++++++-- src/pug/templates/control-view.pug | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/js/control-view.js b/src/js/control-view.js index 2594041..c5c58e1 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -349,10 +349,14 @@ module.exports = { this.mdi = this.history[index]; }, - open: function () { + open_file: function () { utils.clickFileInput("gcode-file-input"); }, + open_folder: function () { + utils.clickFileInput("gcode-folder-input"); + }, + upload_file: async function (e) { const files = e.target.files || e.dataTransfer.files; if (!files.length) { @@ -396,7 +400,7 @@ module.exports = { }); }, - upload_folder: function (e) { + upload_folder: async function (e) { console.log(e); const folderInput = document.getElementById('folderInput'); console.log(folderInput); diff --git a/src/pug/templates/control-view.pug b/src/pug/templates/control-view.pug index 1780006..b17ba67 100644 --- a/src/pug/templates/control-view.pug +++ b/src/pug/templates/control-view.pug @@ -268,7 +268,7 @@ script#control-view-template(type="text/x-template") v-if="false", style="height:100px;width:100px;font-weight:normal") .fa.fa-step-forward - button.pure-button(title="Upload a new GCode program.", @click="open", + button.pure-button(title="Upload a new GCode program.", @click="open_file", :disabled="!is_ready",style="height:100px;width:100px;font-weight:normal") .fa.fa-folder-open @@ -276,9 +276,9 @@ script#control-view-template(type="text/x-template") input(type="file", @change="upload_file", :disabled="!is_ready", accept=".nc,.ngc,.gcode,.gc") - button.pure-button(title="Upload a new GCode folder.", @click="open", + button.pure-button(title="Upload a new GCode folder.", @click="open_folder", :disabled="!is_ready",style="height:100px;width:100px;font-weight:normal") - .fa.fa-folder-plus + .fa.fa-folder form.gcode-folder-input.file-upload input#folderInput(type="file", @change="upload_folder", :disabled="!is_ready",