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;
|
||||
window.__customFrameNativeMenu = true;
|
||||
|
||||
function toggleCheckbox(newElem, toggle) {
|
||||
const tmp = newElem.querySelector("mdui-checkbox");
|
||||
if (tmp && tmp !== undefined) {
|
||||
function toggleCheckbox(elem, toggle) {
|
||||
const checkbox = elem.querySelector("mdui-checkbox");
|
||||
if (!checkbox) return;
|
||||
|
||||
if (toggle) {
|
||||
tmp.setAttribute('checked', '');
|
||||
tmp.setAttribute('value', 'on');
|
||||
checkbox.setAttribute('checked', '');
|
||||
checkbox.setAttribute('value', 'on');
|
||||
} else {
|
||||
tmp.removeAttribute('checked');
|
||||
tmp.setAttribute('value', 'off');
|
||||
}
|
||||
checkbox.removeAttribute('checked');
|
||||
checkbox.setAttribute('value', 'off');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue