From 03847bee4172b3341b75f471b696c236c635e03a Mon Sep 17 00:00:00 2001 From: Henrik Date: Sun, 9 Apr 2023 16:04:55 +0200 Subject: [PATCH] added function for activating granual input --- wled00/data/index.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/wled00/data/index.js b/wled00/data/index.js index 32b52279..2276c397 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -2848,7 +2848,20 @@ function mergeDeep(target, ...sources) } return mergeDeep(target, ...sources); } - +//Call this on what ever page you want to activate opening a dialog on double click on range sliders. +//You can also filter when to call it (activate the functionality) on other things, like device type or setting. +function actDblC(){ + const rngSlds = d.querySelectorAll('input[type="range"]'); + rngSlds.forEach(sld => { + sld.addEventListener("dblclick", () => { + const nVal = prompt(`New value (${sld.min}-${sld.max}):`); + if (nVal !== null) { + sld.value = nVal; + sld.dispatchEvent(new Event("change")); + } + }); + }); +} size(); _C.style.setProperty('--n', N);