增加导航栏

This commit is contained in:
dekun
2026-05-25 17:24:36 +08:00
parent fdb9e9d568
commit 0a42bd4de9
3 changed files with 47 additions and 36 deletions
-19
View File
@@ -721,24 +721,6 @@ function syncKeySlTpFields() {
if (tpEl) tpEl.style.display = mode === "trend_manual" ? "" : "none";
}
function wireKeyMonitorSegGroup(groupId, hiddenInputId, onChange) {
const group = document.getElementById(groupId);
const hidden = document.getElementById(hiddenInputId);
if (!group || !hidden) return;
group.addEventListener("click", (ev) => {
const btn = ev.target.closest && ev.target.closest(".matrix-seg-btn");
if (!btn) return;
group.querySelectorAll(".matrix-seg-btn").forEach((b) => b.classList.remove("is-active"));
btn.classList.add("is-active");
hidden.value = btn.getAttribute("data-value") || "";
if (onChange) onChange();
});
}
function initKeyMonitorSegGroups() {
wireKeyMonitorSegGroup("keyMonitorTypeSeg", "keyMonitorTypeInput");
}
function setKeyMonitorActiveCount(n) {
const el = document.getElementById("keyMonitorActiveCount");
if (el) el.textContent = String(n);
@@ -839,7 +821,6 @@ async function addKeyMonitor() {
}
function wireKeyMonitorPanel() {
initKeyMonitorSegGroups();
const modeSel = document.getElementById("keySlTpModeInput");
if (modeSel) modeSel.addEventListener("change", syncKeySlTpFields);
syncKeySlTpFields();