very minor refactor

This commit is contained in:
Amelia Frost 2026-03-29 00:45:05 -07:00
parent 2f2b4474b4
commit a60a60ab4b
No known key found for this signature in database

View file

@ -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');
}
} }
} }