added function for activating granual input

This commit is contained in:
Henrik 2023-04-09 16:04:55 +02:00
parent d17a41f7f1
commit 03847bee41

View File

@ -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);