From 452ee7775cc913d885aad4184542361d8646f963 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Tue, 30 Jan 2024 21:57:59 +0530 Subject: [PATCH] capturing inputname and color --- src/js/macros.js | 14 +++++++------- src/stylus/style.styl | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/js/macros.js b/src/js/macros.js index 9ac7074..a988993 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -70,15 +70,13 @@ module.exports = { this.$dispatch("macros-edited"); }, editedColor: function (event) { - console.log("color: ", event.target.value); - if (this.config[this.tab - 1].color != event.target.value) { - console.log("Value Changed"); + if (this.config.macros[this.tab - 1].color != event.target.value) { + this.$dispatch("macros-edited"); } }, editedName: function (event) { - console.log("name: ", event.target.value); - if (this.config[this.tab - 1].name != event.target.value) { - console.log("Value Changed"); + if (this.config.macros[this.tab - 1].name != event.target.value) { + this.$dispatch("macros-edited"); } }, showDialogAsync: function (title, file) { @@ -108,7 +106,9 @@ module.exports = { } else { this.newGcode = ""; } - this.$dispatch("macros-edited"); + if (file != this.config.macros[this.tab - 1].file_name) { + this.$dispatch("macros-edited"); + } }, uploadMacrosGcode: async function (e) { const files = e.target.files || e.dataTransfer.files; diff --git a/src/stylus/style.styl b/src/stylus/style.styl index 8aed882..fcdd2b4 100644 --- a/src/stylus/style.styl +++ b/src/stylus/style.styl @@ -709,6 +709,7 @@ span.unit .submit-macros height 50px width 140px + color #000 margin-top 30px font-weight normal border 0