fix(options): expand-all widens money filter so more strikes show

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-10 17:45:02 +08:00
parent 245b85ad27
commit a90876d772
4 changed files with 23 additions and 5 deletions
+14 -1
View File
@@ -1452,7 +1452,15 @@
hint.innerHTML =
'<td colspan="' +
cols +
'" class="muted opt-strike-hint">默认显示 Call/Put 各最近 3 档 · 勾选「显示全部」查看更多</td>';
'" class="muted opt-strike-hint">默认显示 Call/Put 各最近 3 档 · 「显示全部」查看该到期更多行权价(若当前为「仅平值」会自动切到「平/虚」)</td>';
tbody.appendChild(hint);
} else if (state.ooStrikeExpandAll && state.ooMoneyFilter === "otm") {
const hint = document.createElement("tr");
hint.className = "opt-strike-hint-row";
hint.innerHTML =
'<td colspan="' +
cols +
'" class="muted opt-strike-hint">当前为「仅虚值」筛选 · 切到「平/虚」可看平值档</td>';
tbody.appendChild(hint);
}
tbody.querySelectorAll(".hp-oo-pick").forEach(function (btn) {
@@ -1974,6 +1982,11 @@
if ($("hp-oo-expand-all")) {
$("hp-oo-expand-all").addEventListener("click", function () {
state.ooStrikeExpandAll = !state.ooStrikeExpandAll;
// 「仅平值」时本来就只有 1~3 档,展开几乎无变化;展开时自动切到平/虚以便看到全部可选档
if (state.ooStrikeExpandAll && state.ooMoneyFilter === "atm") {
state.ooMoneyFilter = "atm_otm";
syncMoneyUI();
}
syncOoExpandUI();
renderTStrikes();
});
+5
View File
@@ -2219,6 +2219,11 @@
if (expandAllCb) {
expandAllCb.addEventListener("change", function () {
state.strikeExpandAll = !!expandAllCb.checked;
// 实值/虚值筛选下档位本来就少,展开几乎不变;勾选时切回「全部」才有意义
if (state.strikeExpandAll && state.moneyFilter !== "all") {
state.moneyFilter = "all";
syncMoneyFilterButtons();
}
renderStrikes();
});
}