fix(hedge): hide mode-specific fields and default to option-primary
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
ooCloseModeEnabled: root.getAttribute("data-oo-close-mode-enabled") !== "0",
|
||||
ooCloseMode: "close_all",
|
||||
direction: "long",
|
||||
optionPrimary: false,
|
||||
optionPrimary: true,
|
||||
opLevTouched: false,
|
||||
opRatioTouched: false,
|
||||
tradingUsdc: null,
|
||||
@@ -279,15 +279,18 @@
|
||||
});
|
||||
const ins = $("hp-po-fields-insurance");
|
||||
const op = $("hp-po-fields-option-primary");
|
||||
// 保险模式只显示开仓价/张数/止盈止损;以期权为主只显示权利金等执行参数
|
||||
if (ins) {
|
||||
ins.classList.toggle("hidden", on);
|
||||
if (on) ins.setAttribute("hidden", "hidden");
|
||||
else ins.removeAttribute("hidden");
|
||||
ins.style.display = on ? "none" : "";
|
||||
}
|
||||
if (op) {
|
||||
op.classList.toggle("hidden", !on);
|
||||
if (!on) op.setAttribute("hidden", "hidden");
|
||||
else op.removeAttribute("hidden");
|
||||
op.style.display = on ? "" : "none";
|
||||
}
|
||||
const otmBtn = document.querySelector(".hp-money-otm");
|
||||
if (otmBtn) {
|
||||
@@ -2533,5 +2536,6 @@
|
||||
applyBudgetBuffer(state.budgetBuffer);
|
||||
updateOoBudgetLine(null);
|
||||
bind();
|
||||
syncOptionPrimaryUI();
|
||||
void refreshAll();
|
||||
})();
|
||||
|
||||
@@ -3480,6 +3480,11 @@ html[data-theme="light"] .opt-be-dist-down {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
/* display:grid 会盖掉 [hidden];模式切换必须显式 none */
|
||||
.hedge-plan-page-wrap .hp-po-fields.hidden,
|
||||
.hedge-plan-page-wrap .hp-po-fields[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
.hedge-plan-page-wrap .hp-po-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in New Issue
Block a user