Fix tooltip
Messages showing correctly according to their respective effect.
This commit is contained in:
parent
df155bed89
commit
a485451328
@ -1502,16 +1502,22 @@ function setEffectParameters(idx)
|
||||
var paOnOff = (effectPars.length<3 || effectPars[2]=='')?[]:effectPars[2].split(",");
|
||||
|
||||
// set html slider items on/off
|
||||
let nSliders = 5;
|
||||
for (let i=0; i<nSliders; i++) {
|
||||
var slider = gId("slider" + i);
|
||||
// if (not controlDefined and for AC speed or intensity and for SR all sliders) or slider has a value
|
||||
let sliders = d.querySelectorAll("#sliders .slider");
|
||||
|
||||
sliders.forEach(function(slider, i){
|
||||
const tooltip = slider.querySelector('[tooltip]');
|
||||
const text = tooltip.getAttribute("tooltip");
|
||||
|
||||
if ((!controlDefined && i < ((idx < 128) ? 2 : nSliders)) || (slOnOff.length > i && slOnOff[i] != "")) {
|
||||
const newText = slOnOff.length > i && slOnOff[i] != "!" ? slOnOff[i] : text;
|
||||
tooltip.setAttribute("tooltip", newText);
|
||||
|
||||
slider.classList.remove('hide');
|
||||
} else {
|
||||
slider.classList.add('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (slOnOff.length>5) { // up to 3 checkboxes
|
||||
gId('fxopt').classList.remove('fade');
|
||||
for (let i = 0; i<3; i++) {
|
||||
@ -2949,8 +2955,6 @@ function tooltip(){
|
||||
|
||||
const { offsetHeight, offsetWidth } = tooltip;
|
||||
|
||||
console.log(element.type);
|
||||
|
||||
const multiplier = element.type == "range" ? 0.2 : 0.4;
|
||||
const newTop = top - (offsetHeight + (offsetHeight * multiplier));
|
||||
const newLeft = left + (width / 2) - (offsetWidth / 2);
|
||||
|
3576
wled00/html_ui.h
3576
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user