From e7795b2742df80fbdce7538c7494baa60e2b9532 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Thu, 22 Feb 2024 04:30:11 +0530 Subject: [PATCH] adding to checkbox --- src/js/macros.js | 5 ++--- src/pug/templates/macros.pug | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index 137880c..aa2eee9 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -71,9 +71,8 @@ module.exports = { this.$dispatch("macros-edited"); } }, - editedAlert: function (event) { - if (this.tab != 0 && this.config.macros[this.tab - 1].alert != event.target.value) { - console.log(event.target.value); + editedAlert: function () { + if (this.tab != 0 && this.config.macros[this.tab - 1].alert != this.isChecked) { this.$dispatch("macros-edited"); } }, diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index 8a3fca2..2666bea 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -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-name(type="text",minlength='1',maxlength='15',id="macros-name" ,v-model="macrosName",@keypress="editedName") div - input.input-alert(type="checkbox",id="macros-alert" v-model="isChecked") + input.input-alert(type="checkbox",id="macros-alert" v-model="isChecked",@change="editedAlert") label Would you like an alert when running this macro? p.title Macros G-Code .flex-row-container