mirror of
https://github.com/wled/WLED.git
synced 2025-07-17 07:46:32 +00:00
Do not hide filter menu if filter is active
This commit is contained in:
parent
7ea8f741f2
commit
ceb330e3e4
@ -232,6 +232,7 @@ function onLoad()
|
|||||||
|
|
||||||
tooltip();
|
tooltip();
|
||||||
resetPUtil();
|
resetPUtil();
|
||||||
|
initFilters();
|
||||||
|
|
||||||
if (localStorage.getItem('pcm') == "true" || (!/Mobi/.test(navigator.userAgent) && localStorage.getItem('pcm') == null)) togglePcMode(true);
|
if (localStorage.getItem('pcm') == "true" || (!/Mobi/.test(navigator.userAgent) && localStorage.getItem('pcm') == null)) togglePcMode(true);
|
||||||
applyCfg();
|
applyCfg();
|
||||||
@ -2764,6 +2765,10 @@ function clean(clearButton) {
|
|||||||
search(inputField, clearButton.parentElement.nextElementSibling.id);
|
search(inputField, clearButton.parentElement.nextElementSibling.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initFilters() {
|
||||||
|
gId("filters").querySelectorAll("input[type=checkbox]").forEach((e) => { e.checked = false; });
|
||||||
|
}
|
||||||
|
|
||||||
function filterFocus(e) {
|
function filterFocus(e) {
|
||||||
const f = gId("filters");
|
const f = gId("filters");
|
||||||
if (e.type === "focus") f.classList.remove('fade'); // immediately show (still has transition)
|
if (e.type === "focus") f.classList.remove('fade'); // immediately show (still has transition)
|
||||||
@ -2775,6 +2780,8 @@ function filterFocus(e) {
|
|||||||
if (e.type === "blur") {
|
if (e.type === "blur") {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (e.target === document.activeElement && document.hasFocus()) return;
|
if (e.target === document.activeElement && document.hasFocus()) return;
|
||||||
|
// do not hide if filter is active
|
||||||
|
if (gId("filters").querySelectorAll("input[type=checkbox]:checked").length) return;
|
||||||
f.classList.add('fade');
|
f.classList.add('fade');
|
||||||
}, 255); // wait with hiding
|
}, 255); // wait with hiding
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user