From 9b8e52edafb2c23fa358e7b3707edc82de51cc25 Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Sat, 30 Dec 2023 16:24:50 +0530 Subject: [PATCH] macros ui fix and control view added present and absent class --- src/js/control-view.js | 11 +---------- src/js/macros.js | 2 +- src/pug/templates/control-view.pug | 12 ++++-------- src/pug/templates/macros.pug | 2 +- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/js/control-view.js b/src/js/control-view.js index cf73c7e..464bdd7 100644 --- a/src/js/control-view.js +++ b/src/js/control-view.js @@ -203,17 +203,8 @@ module.exports = { return Math.min(1, p); }, isMacrosPresent: function(){ - return true; - // if(this.config.macros!=undefined){ - // console.log("isMacrosPresent",this.config.macros!=undefined); - // console.log(this.config.macros.length!=0); - // return this.config.macros.length!=0; - // } - // return false; + return this.config.macros!=undefined; }, - isMacrosAbsent: function(){ - return false; - } }, events: { diff --git a/src/js/macros.js b/src/js/macros.js index b2b6c87..6f84bac 100644 --- a/src/js/macros.js +++ b/src/js/macros.js @@ -24,7 +24,7 @@ module.exports = { if (state != "ESTOPPED" && (cycle == "jogging" || cycle == "homing")) { return cycle.toUpperCase(); } - + return state || ""; }, is_ready: function() { diff --git a/src/pug/templates/control-view.pug b/src/pug/templates/control-view.pug index 5b9b985..c208a34 100644 --- a/src/pug/templates/control-view.pug +++ b/src/pug/templates/control-view.pug @@ -209,15 +209,11 @@ script#control-view-template(type="text/x-template") .macros-div p Macros - .test-true(v-if="isMacrosPresent") - p true - .test-false(v-if="isMacrosAbsent") - p false` - .macros-buttons(v-if="config.macros!=undefined") + .macros-buttons(class="present",v-if="isMacrosPresent") p there is a active macro - .macros-buttons(v-if="config.macros==undefined") - p there is no macro - + .macros-buttons(class ="absent",v-if="!isMacrosPresent") + p there is No macro + .tabs diff --git a/src/pug/templates/macros.pug b/src/pug/templates/macros.pug index ef2f41a..b8dcf2f 100644 --- a/src/pug/templates/macros.pug +++ b/src/pug/templates/macros.pug @@ -15,7 +15,7 @@ script#macros-template(type="text/x-template") :disabled="!is_ready",style="height:40px;width:130px;font-weight:normal;border-radius:5px") Upload br button.submit-macros(title="Save Macros",@click="saveMacros", - style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border-color:#add1ad;padding-top:5px") Save Macros + style="height:50px;width:140px;font-weight:normal;background-color:#add1ad;color:#fff;border-color:#add1ad;margin-top:15px") Save Macros button.pure-button(title="Print config.", @click="printConfig", style="height:50px;width:120px;font-weight:normal;padding-top:5px") print Config