From e8481eaabf076cc64fc72bf1aaac416843ae0363 Mon Sep 17 00:00:00 2001 From: pandrr Date: Thu, 16 Nov 2023 15:45:14 +0100 Subject: [PATCH] value reset --- html/ui/templates/params_port.html | 3 ++- icons/exit.svg | 24 +------------------ icons/feathericons/undo.svg | 5 +--- scss/components/params.scss | 20 ++++++++++++++++ .../components/opparampanel/params_helper.js | 5 ++-- 5 files changed, 27 insertions(+), 30 deletions(-) diff --git a/html/ui/templates/params_port.html b/html/ui/templates/params_port.html index 6a58c5812..12e3c73d4 100644 --- a/html/ui/templates/params_port.html +++ b/html/ui/templates/params_port.html @@ -52,7 +52,8 @@ {{/compare}} {{/compare}} - + + {{#if port.uiAttribs.colorPick }}
diff --git a/icons/exit.svg b/icons/exit.svg index 4b01569eb..d454f1d7a 100644 --- a/icons/exit.svg +++ b/icons/exit.svg @@ -1,23 +1 @@ - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/icons/feathericons/undo.svg b/icons/feathericons/undo.svg index e3edffbed..bcfc10648 100644 --- a/icons/feathericons/undo.svg +++ b/icons/feathericons/undo.svg @@ -1,4 +1 @@ - - - - \ No newline at end of file + \ No newline at end of file diff --git a/scss/components/params.scss b/scss/components/params.scss index e2870d7e3..126786e85 100644 --- a/scss/components/params.scss +++ b/scss/components/params.scss @@ -17,6 +17,26 @@ } } + .reset_hidden + { + pointer-events: none; + opacity: 0.0 !important; + } + + .param_reset + { + opacity:0; + cursor:pointer; + vertical-align: middle; + opacity: 0.5; + + background-color: red; + &:hover + { + opacity: 1 !important; + + } + } .panel_head { diff --git a/src/ui/components/opparampanel/params_helper.js b/src/ui/components/opparampanel/params_helper.js index 9a78f0c1c..53dc0ed69 100644 --- a/src/ui/components/opparampanel/params_helper.js +++ b/src/ui/components/opparampanel/params_helper.js @@ -96,10 +96,11 @@ const paramsHelper = const isDefault = port.get() == port.defaultValue; if (titleEl) titleEl.classList.toggle("nonDefaultValue", !isDefault); - if (isDefault) resetEl.style.opacity = 0.0; + if (isDefault) resetEl.classList.add("reset_hidden"); else { - resetEl.style.opacity = 1; + resetEl.classList.remove("reset_hidden"); + // if (!resetEl.classList.contains("listener")) // {