(menuId, checked = false)
| 999 | |
| 1000 | // 设置统一的开关视觉状态,避免节点不存在时抛出错误。 |
| 1001 | const setToggleChecked = function (menuId, checked = false) { |
| 1002 | const ncheck = $(`#${menuId} .checkbutton`); |
| 1003 | if (!ncheck) { |
| 1004 | return; |
| 1005 | } |
| 1006 | if (checked) { |
| 1007 | ncheck.classList.add("checked"); |
| 1008 | } else { |
| 1009 | ncheck.classList.remove("checked"); |
| 1010 | } |
| 1011 | }; |
| 1012 | |
| 1013 | const normalizeKcgHue = function (value) { |
| 1014 | const parsed = parseInt(value); |
no test coverage detected