finxing savemacros
This commit is contained in:
@@ -181,7 +181,9 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
saveMacros: async function () {
|
saveMacros: async function () {
|
||||||
const macrosList = this.config.macros.splice(this.tab - 1, 1).map(item => item.name);
|
const macros = this.config.macros;
|
||||||
|
macros.splice(this.tab - 1, 1);
|
||||||
|
const macrosList = macros.map(item => item.name);
|
||||||
var macrosName = document.getElementById("macros-name").value;
|
var macrosName = document.getElementById("macros-name").value;
|
||||||
console.log("Macros Name: ", this.macrosName);
|
console.log("Macros Name: ", this.macrosName);
|
||||||
var macrosColor = document.getElementById("macros-color").value;
|
var macrosColor = document.getElementById("macros-color").value;
|
||||||
@@ -242,7 +244,7 @@ module.exports = {
|
|||||||
this.config.macrosList = [];
|
this.config.macrosList = [];
|
||||||
},
|
},
|
||||||
clearMacros: async function () {
|
clearMacros: async function () {
|
||||||
if (this.tab == 0) {
|
if (this.tab == 0 || this.tab > this.config.macros.length) {
|
||||||
document.getElementById("macros-name").value = "";
|
document.getElementById("macros-name").value = "";
|
||||||
document.getElementById("macros-color").value = "#ffffff";
|
document.getElementById("macros-color").value = "#ffffff";
|
||||||
this.fileName = "default";
|
this.fileName = "default";
|
||||||
@@ -340,6 +342,7 @@ module.exports = {
|
|||||||
file_name: "default",
|
file_name: "default",
|
||||||
};
|
};
|
||||||
this.config.macros.push(newMacros);
|
this.config.macros.push(newMacros);
|
||||||
|
this.addMacros = false;
|
||||||
try {
|
try {
|
||||||
await api.put("config/save", this.config);
|
await api.put("config/save", this.config);
|
||||||
this.$dispatch("update");
|
this.$dispatch("update");
|
||||||
|
|||||||
Reference in New Issue
Block a user