kopia lustrzana https://github.com/Aircoookie/WLED
* Prevent UI from sliding when using sliders (#1400)
An iro.js version bump in commit 98e4ac6
changed names for the slider &
colorwheel classes which made the filter in function lock() fail.
Also it seems that not all elements of the Iro sliders & colorwheel have
appropriate classes set. Just changing the names still sometimes failed
when the user accidentally grabbed a part of the slider / colorwheel
that has no class name set.
To mitigate this, lock() now checks the events classlist for classes
starting with "Iro" as well as it's parents classlist if no "Iro" classes
were found
* Regenerate wled00/html_ui.h
pull/1464/head
rodzic
bdaef7e541
commit
7684fb83d6
|
@ -2443,10 +2443,23 @@ let iSlide = 0, x0 = null, scrollS = 0, locked = false, w;
|
||||||
|
|
||||||
function unify(e) { return e.changedTouches ? e.changedTouches[0] : e }
|
function unify(e) { return e.changedTouches ? e.changedTouches[0] : e }
|
||||||
|
|
||||||
|
function hasIroClass(classList) {
|
||||||
|
for (var i = 0; i < classList.length; i++) {
|
||||||
|
var element = classList[i];
|
||||||
|
if (element.startsWith('Iro')) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function lock(e) {
|
function lock(e) {
|
||||||
if (pcMode) return;
|
if (pcMode) return;
|
||||||
var l = e.target.classList;
|
var l = e.target.classList;
|
||||||
if (l.contains('noslide') || l.contains('iro__wheel__saturation') || l.contains('iro__slider__value') || l.contains('iro__slider')) return;
|
var pl = e.target.parentElement.classList;
|
||||||
|
|
||||||
|
if (l.contains('noslide') || hasIroClass(l) || hasIroClass(pl)) return;
|
||||||
|
|
||||||
x0 = unify(e).clientX;
|
x0 = unify(e).clientX;
|
||||||
scrollS = d.getElementsByClassName("tabcontent")[iSlide].scrollTop;
|
scrollS = d.getElementsByClassName("tabcontent")[iSlide].scrollTop;
|
||||||
|
|
||||||
|
|
2839
wled00/html_ui.h
2839
wled00/html_ui.h
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue