diff --git a/src/js/macros.js b/src/js/macros.js index ae2804b..c4482b9 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -108,7 +108,8 @@ module.exports = { this.$set("selectedValues[this.tab - 1]", file.name); this.$dispatch("macros-edited"); - + console.log("file.name", file.name); + console.log("file.name type: ", typeof file.name); SvelteComponents.showDialog("Upload", { file, onComplete: () => { @@ -189,11 +190,13 @@ module.exports = { delete_current: async function () { console.log("delete a gcode"); if (this.selectedValues[this.tab - 1] == "default") { - this.$set("newGcode[this.tab-1]", ""); + this.$set("newGcode[this.tab - 1]", ""); } else { api.delete(`file/${this.selectedValues[this.tab - 1]}`); - this.$set("newGcode[this.tab-1]", ""); - this.$set("this.selectedValues[this.tab - 1]", "default"); + // this.$set("newGcode[this.tab-1]", ""); + // this.$set("this.selectedValues[this.tab - 1]", "default"); + this.$set("newGcode[this.tab - 1]", ""); + this.$set("selectedValues[this.tab - 1]", "default"); this.config.macrosList = this.config.macrosList.filter( item => item.file_name !== this.selectedValues[this.tab - 1], ); @@ -223,8 +226,8 @@ module.exports = { const defaultValue = this.config.macros[this.tab - 1]; document.getElementById(`macros-name-${this.tab - 1}`).value = defaultValue.name; document.getElementById(`macros-color-${this.tab - 1}`).value = defaultValue.color; - this.$set("selectedValues[this.tab-1]", "default"); - this.$set("newGcode[this.tab-1]", ""); + this.$set("newGcode[this.tab - 1]", ""); + this.$set("selectedValues[this.tab - 1]", "default"); }, deleteAllMacros: async function () { this.config.macros = [ diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index 70a8c55..9040c0d 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -281,7 +281,7 @@ script#macros-template(type="text/x-template") .gcodeContainer textarea.new-gcode( :value='newGcode[tab-1]' @input="updateNewGcode") - button.submit-macros(title="Save Macros",@click="confirmSave=true",:disabled="!edited") Save + button.submit-macros.button-success(title="Save Macros",@click="confirmSave=true",:disabled="!edited") Save button.submit-macros(title="Cancel Macros",@click="cancelMacros",style="margin-left:5px") Cancel button.submit-macros(title="Cancel Macros",@click="printState",style="margin-left:5px") Print State diff --git a/src/stylus/style.styl b/src/stylus/style.styl index 1581bb2..6bd8726 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -693,7 +693,6 @@ span.unit width 140px margin-top 30px font-weight normal - background-color #add1ad color #fff border 0