DOM to State

This commit is contained in:
sanjayk03-dev
2024-02-22 04:25:24 +05:30
parent e3dd75df69
commit 2eb775d418
2 changed files with 4 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ module.exports = {
addMacros: false, addMacros: false,
maxLimitReached: false, maxLimitReached: false,
macrosName: "", macrosName: "",
isChecked: false,
fileName: "default", fileName: "default",
newGcode: "", newGcode: "",
}; };
@@ -201,7 +202,8 @@ module.exports = {
const macrosList = macros.map(item => item.name); const macrosList = macros.map(item => item.name);
var macrosName = document.getElementById("macros-name").value; var macrosName = document.getElementById("macros-name").value;
var macrosColor = document.getElementById("macros-color").value; var macrosColor = document.getElementById("macros-color").value;
var macrosAlert = document.getElementById("macros-alert").value; var macrosAlert = this.isChecked;
console.log(macrosAlert);
const formattedFilename = macrosName const formattedFilename = macrosName
.replace(/\\/g, "_") .replace(/\\/g, "_")
.replace(/\//g, "_") .replace(/\//g, "_")

View File

@@ -83,7 +83,7 @@ script#macros-template(type="text/x-template")
input.input-color(type="color",id="macros-color",value="#ffffff",@change="editedColor") input.input-color(type="color",id="macros-color",value="#ffffff",@change="editedColor")
input.input-name(type="text",minlength='1',maxlength='15',id="macros-name" ,v-model="macrosName",@keypress="editedName") input.input-name(type="text",minlength='1',maxlength='15',id="macros-name" ,v-model="macrosName",@keypress="editedName")
div div
input.input-alert(type="checkbox",id="macros-alert" value="false",@change="editedAlert") input.input-alert(type="checkbox",id="macros-alert" v-model="isChecked")
label Would you like an alert when running this macro? label Would you like an alert when running this macro?
p.title Macros G-Code p.title Macros G-Code
.flex-row-container .flex-row-container