diff --git a/crypto_monitor_binance/templates/index.html b/crypto_monitor_binance/templates/index.html index 0a9be8d..3eb2b9c 100644 --- a/crypto_monitor_binance/templates/index.html +++ b/crypto_monitor_binance/templates/index.html @@ -3,8 +3,8 @@ - - + + diff --git a/crypto_monitor_gate/templates/index.html b/crypto_monitor_gate/templates/index.html index ab864db..e4f66c7 100644 --- a/crypto_monitor_gate/templates/index.html +++ b/crypto_monitor_gate/templates/index.html @@ -3,8 +3,8 @@ - - + + diff --git a/crypto_monitor_gate_bot/templates/index.html b/crypto_monitor_gate_bot/templates/index.html index ab864db..e4f66c7 100644 --- a/crypto_monitor_gate_bot/templates/index.html +++ b/crypto_monitor_gate_bot/templates/index.html @@ -3,8 +3,8 @@ - - + + diff --git a/crypto_monitor_okx/templates/index.html b/crypto_monitor_okx/templates/index.html index a32063c..afeae68 100644 --- a/crypto_monitor_okx/templates/index.html +++ b/crypto_monitor_okx/templates/index.html @@ -3,8 +3,8 @@ - - + + diff --git a/static/instance_theme.js b/static/instance_theme.js index e470ee7..1ea7864 100644 --- a/static/instance_theme.js +++ b/static/instance_theme.js @@ -296,6 +296,39 @@ apply(data.theme, { skipStore: true }); } + /** 交易记录页:核对开关与按钮 disabled 保持同步(iframe 软导航/表单恢复后不触发 change) */ + function syncReviewEditButtons() { + const toggle = document.getElementById("review-mode-toggle"); + if (!toggle) return; + const on = !!toggle.checked; + document.querySelectorAll(".review-edit-btn").forEach((btn) => { + btn.disabled = !on; + }); + } + + function initReviewEditModeSync() { + const toggle = document.getElementById("review-mode-toggle"); + if (!toggle) return; + if (toggle.dataset.instReviewModeBound !== "1") { + toggle.dataset.instReviewModeBound = "1"; + toggle.addEventListener("input", () => { + if (typeof global.toggleReviewMode === "function") global.toggleReviewMode(); + else syncReviewEditButtons(); + }); + } + const run = () => { + if (typeof global.toggleReviewMode === "function") global.toggleReviewMode(); + else syncReviewEditButtons(); + }; + run(); + requestAnimationFrame(run); + setTimeout(run, 0); + if (!global.__instReviewModePageshowBound) { + global.__instReviewModePageshowBound = true; + window.addEventListener("pageshow", run); + } + } + /** 中控 iframe 内:拦截顶栏导航,fetch 后 document.write 原地换页,避免 iframe 卸载白屏 */ function initHubEmbedInFrameNav() { if (!isHubLinked()) return; @@ -391,6 +424,7 @@ const onReady = () => { initToggleUI(); initMobileTopNav(); + initReviewEditModeSync(); syncInlineStyles(get()); patchHubNavLinks(get()); observeDynamicLists(); @@ -422,5 +456,7 @@ syncInlineStyles, patchHubNavLinks, mergeHubQueryIntoHref, + syncReviewEditButtons, + initReviewEditModeSync, }; })(typeof window !== "undefined" ? window : globalThis); diff --git a/static/instance_theme_early.css b/static/instance_theme_early.css index ea20632..f67270b 100644 --- a/static/instance_theme_early.css +++ b/static/instance_theme_early.css @@ -14,6 +14,11 @@ html[data-theme="light"] body { color: #1a2838 !important; } +.review-edit-btn:disabled { + opacity: 0.45; + cursor: not-allowed; +} + html[data-theme="light"] .header h1 { color: #142232 !important; }