very minor refactor
This commit is contained in:
parent
2f2b4474b4
commit
a60a60ab4b
1 changed files with 10 additions and 10 deletions
|
|
@ -2,16 +2,16 @@
|
||||||
if (window.__customFrameNativeMenu) return;
|
if (window.__customFrameNativeMenu) return;
|
||||||
window.__customFrameNativeMenu = true;
|
window.__customFrameNativeMenu = true;
|
||||||
|
|
||||||
function toggleCheckbox(newElem, toggle) {
|
function toggleCheckbox(elem, toggle) {
|
||||||
const tmp = newElem.querySelector("mdui-checkbox");
|
const checkbox = elem.querySelector("mdui-checkbox");
|
||||||
if (tmp && tmp !== undefined) {
|
if (!checkbox) return;
|
||||||
|
|
||||||
if (toggle) {
|
if (toggle) {
|
||||||
tmp.setAttribute('checked', '');
|
checkbox.setAttribute('checked', '');
|
||||||
tmp.setAttribute('value', 'on');
|
checkbox.setAttribute('value', 'on');
|
||||||
} else {
|
} else {
|
||||||
tmp.removeAttribute('checked');
|
checkbox.removeAttribute('checked');
|
||||||
tmp.setAttribute('value', 'off');
|
checkbox.setAttribute('value', 'off');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue