bug fix in save macros
This commit is contained in:
@@ -224,7 +224,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
save_macro: async function () {
|
save_macro: async function () {
|
||||||
if (this.tab == 0 || !this.state.macros[this.tab - 1]) {
|
if (this.tab == 0 || !this.state.macros[this.tab - 1]) {
|
||||||
this.load_macro();
|
|
||||||
this.confirmSave = false;
|
this.confirmSave = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -323,10 +322,11 @@ module.exports = {
|
|||||||
this.deleteGCode = false;
|
this.deleteGCode = false;
|
||||||
},
|
},
|
||||||
load_macro: async function () {
|
load_macro: async function () {
|
||||||
if (this.tab == 0) {
|
if (this.tab == 0 || !this.state.macros[this.tab - 1]) {
|
||||||
document.getElementById("macros-name").value = "";
|
document.getElementById("macros-name").value = "";
|
||||||
document.getElementById("macros-color").value = "#ffffff";
|
document.getElementById("macros-color").value = "#ffffff";
|
||||||
this.isChecked = true;
|
this.isChecked = true;
|
||||||
|
this.tab = "0";
|
||||||
this.fileName = "default";
|
this.fileName = "default";
|
||||||
this.newGcode = "";
|
this.newGcode = "";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -40,16 +40,16 @@ script#macros-template(type="text/x-template")
|
|||||||
|
|
||||||
h1 Macros Configuration
|
h1 Macros Configuration
|
||||||
.flex-row-container
|
.flex-row-container
|
||||||
button.config-button.button-blue(title="Reset Macros", @click="confirmReset=true") Delete All
|
button.config-button.button-blue(title="Reset Macros", @click="confirmReset=true") Reset
|
||||||
|
|
||||||
message(:show.sync="confirmReset")
|
message(:show.sync="confirmReset")
|
||||||
h3(slot="header") Delete All Macros?
|
h3(slot="header") Reset Macros?
|
||||||
div(slot="body")
|
div(slot="body")
|
||||||
p Are you sure you want to delete all macros?
|
p Are you sure you want to reset all macros?
|
||||||
div(slot="footer")
|
div(slot="footer")
|
||||||
button.pure-button(@click="confirmReset=false") Cancel
|
button.pure-button(@click="confirmReset=false") Cancel
|
||||||
button.pure-button.button-error(@click="delete_all_macros")
|
button.pure-button.button-error(@click="delete_all_macros")
|
||||||
| Delete All
|
| Reset
|
||||||
|
|
||||||
button.config-button.button-blue(title="Add a Macros", @click="addMacros=true", style="margin-left:5px") New Macro
|
button.config-button.button-blue(title="Add a Macros", @click="addMacros=true", style="margin-left:5px") New Macro
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user