prevent excessively setting CONTAINER's disabled state
This commit is contained in:
parent
1a16ce8925
commit
e916257250
1 changed files with 9 additions and 1 deletions
|
@ -386,6 +386,9 @@ export default class windowman {
|
||||||
input_element.getAttribute("data-enable"),
|
input_element.getAttribute("data-enable"),
|
||||||
))
|
))
|
||||||
: false);
|
: false);
|
||||||
|
if ((input_element.parentElement.nodeName.toLowerCase()).includes(`li`)) {
|
||||||
|
input_element.parentElement.disabled = input_element.disabled;
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -495,9 +498,9 @@ export default class windowman {
|
||||||
|
|
||||||
if (CONTAINERS) {
|
if (CONTAINERS) {
|
||||||
(CONTAINERS).forEach((CONTAINER) => {
|
(CONTAINERS).forEach((CONTAINER) => {
|
||||||
|
CONTAINER.disabled = (ITEM != null) ? !((typeof ITEM).includes(`obj`) && !Array.isArray(ITEM)) : true;
|
||||||
([].concat(CONTAINER.querySelectorAll(`[data-result-content]`), CONTAINER.querySelectorAll(`[data-result-store]`), document.querySelectorAll(`[data-result-enable]`))).forEach(async function (ELEMENTS) {
|
([].concat(CONTAINER.querySelectorAll(`[data-result-content]`), CONTAINER.querySelectorAll(`[data-result-store]`), document.querySelectorAll(`[data-result-enable]`))).forEach(async function (ELEMENTS) {
|
||||||
if (ELEMENTS) {
|
if (ELEMENTS) {
|
||||||
CONTAINER.disabled = (ITEM != null) ? !((typeof ITEM).includes(`obj`) && !Array.isArray(ITEM)) : true;
|
|
||||||
(ELEMENTS).forEach(async function(ELEMENT) {
|
(ELEMENTS).forEach(async function(ELEMENT) {
|
||||||
ELEMENT.disabled = CONTAINER.disabled;
|
ELEMENT.disabled = CONTAINER.disabled;
|
||||||
if (!ELEMENT.disabled) {
|
if (!ELEMENT.disabled) {
|
||||||
|
@ -575,6 +578,11 @@ export default class windowman {
|
||||||
} else if (ELEMENT.getAttribute(`data-result-content`) || ELEMENT.getAttribute(`data-result-store`)) {
|
} else if (ELEMENT.getAttribute(`data-result-content`) || ELEMENT.getAttribute(`data-result-store`)) {
|
||||||
ELEMENT.innerText = ``;
|
ELEMENT.innerText = ``;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable the list element if in case it is a clickable element.
|
||||||
|
if ((ELEMENT.parentElement.nodeName.toLowerCase()).includes(`li`)) {
|
||||||
|
ELEMENT.parentElement.disabled = CONTAINER.disabled;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue