fix(instance): restore review edit button after hub iframe nav
Sync review-mode checkbox with disabled state after form restore; repair initHubEmbedInFrameNav regression in instance_theme.js. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||||
<script src="/static/instance_theme.js?v=8"></script>
|
<script src="/static/instance_theme.js?v=9"></script>
|
||||||
<link rel="stylesheet" href="/static/instance_theme_early.css?v=3">
|
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
|
||||||
<link rel="stylesheet" href="/static/account_risk_badge.css?v=2">
|
<link rel="stylesheet" href="/static/account_risk_badge.css?v=2">
|
||||||
|
|
||||||
<meta name="theme-color" content="#0b0d14">
|
<meta name="theme-color" content="#0b0d14">
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||||
<script src="/static/instance_theme.js?v=8"></script>
|
<script src="/static/instance_theme.js?v=9"></script>
|
||||||
<link rel="stylesheet" href="/static/instance_theme_early.css?v=3">
|
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
|
||||||
<link rel="stylesheet" href="/static/account_risk_badge.css?v=2">
|
<link rel="stylesheet" href="/static/account_risk_badge.css?v=2">
|
||||||
|
|
||||||
<meta name="theme-color" content="#0b0d14">
|
<meta name="theme-color" content="#0b0d14">
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||||
<script src="/static/instance_theme.js?v=8"></script>
|
<script src="/static/instance_theme.js?v=9"></script>
|
||||||
<link rel="stylesheet" href="/static/instance_theme_early.css?v=3">
|
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
|
||||||
<link rel="stylesheet" href="/static/account_risk_badge.css?v=2">
|
<link rel="stylesheet" href="/static/account_risk_badge.css?v=2">
|
||||||
|
|
||||||
<meta name="theme-color" content="#0b0d14">
|
<meta name="theme-color" content="#0b0d14">
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||||
<script src="/static/instance_theme.js?v=8"></script>
|
<script src="/static/instance_theme.js?v=9"></script>
|
||||||
<link rel="stylesheet" href="/static/instance_theme_early.css?v=3">
|
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
|
||||||
<link rel="stylesheet" href="/static/account_risk_badge.css?v=2">
|
<link rel="stylesheet" href="/static/account_risk_badge.css?v=2">
|
||||||
|
|
||||||
<meta name="theme-color" content="#0b0d14">
|
<meta name="theme-color" content="#0b0d14">
|
||||||
|
|||||||
@@ -296,6 +296,39 @@
|
|||||||
apply(data.theme, { skipStore: true });
|
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 卸载白屏 */
|
/** 中控 iframe 内:拦截顶栏导航,fetch 后 document.write 原地换页,避免 iframe 卸载白屏 */
|
||||||
function initHubEmbedInFrameNav() {
|
function initHubEmbedInFrameNav() {
|
||||||
if (!isHubLinked()) return;
|
if (!isHubLinked()) return;
|
||||||
@@ -391,6 +424,7 @@
|
|||||||
const onReady = () => {
|
const onReady = () => {
|
||||||
initToggleUI();
|
initToggleUI();
|
||||||
initMobileTopNav();
|
initMobileTopNav();
|
||||||
|
initReviewEditModeSync();
|
||||||
syncInlineStyles(get());
|
syncInlineStyles(get());
|
||||||
patchHubNavLinks(get());
|
patchHubNavLinks(get());
|
||||||
observeDynamicLists();
|
observeDynamicLists();
|
||||||
@@ -422,5 +456,7 @@
|
|||||||
syncInlineStyles,
|
syncInlineStyles,
|
||||||
patchHubNavLinks,
|
patchHubNavLinks,
|
||||||
mergeHubQueryIntoHref,
|
mergeHubQueryIntoHref,
|
||||||
|
syncReviewEditButtons,
|
||||||
|
initReviewEditModeSync,
|
||||||
};
|
};
|
||||||
})(typeof window !== "undefined" ? window : globalThis);
|
})(typeof window !== "undefined" ? window : globalThis);
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ html[data-theme="light"] body {
|
|||||||
color: #1a2838 !important;
|
color: #1a2838 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.review-edit-btn:disabled {
|
||||||
|
opacity: 0.45;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
html[data-theme="light"] .header h1 {
|
html[data-theme="light"] .header h1 {
|
||||||
color: #142232 !important;
|
color: #142232 !important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user