Phone hub folds: emergency ops, market toolbar, calc tabs, OKX options.
Collapse bulky monitor/market controls by default on phone, show OKX options on tiles, add calculator tab switch, and request landscape on market fullscreen. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -572,6 +572,37 @@
|
||||
}
|
||||
}
|
||||
|
||||
function applyCalcTab(tab) {
|
||||
const t = tab === "roll" ? "roll" : "trend";
|
||||
const layout = page.querySelector(".calc-layout");
|
||||
if (layout) layout.setAttribute("data-calc-tab", t);
|
||||
page.querySelectorAll(".calc-m-tab").forEach(function (btn) {
|
||||
const on = (btn.getAttribute("data-calc-tab") || "") === t;
|
||||
btn.classList.toggle("is-active", on);
|
||||
btn.setAttribute("aria-selected", on ? "true" : "false");
|
||||
});
|
||||
try {
|
||||
sessionStorage.setItem("hub_calc_tab", t);
|
||||
} catch (e) {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
function bindCalcTabs() {
|
||||
page.querySelectorAll(".calc-m-tab").forEach(function (btn) {
|
||||
btn.addEventListener("click", function () {
|
||||
applyCalcTab(btn.getAttribute("data-calc-tab") || "trend");
|
||||
});
|
||||
});
|
||||
let saved = "trend";
|
||||
try {
|
||||
saved = sessionStorage.getItem("hub_calc_tab") || "trend";
|
||||
} catch (e) {
|
||||
saved = "trend";
|
||||
}
|
||||
applyCalcTab(saved);
|
||||
}
|
||||
|
||||
async function bindOnce() {
|
||||
if (inited) return;
|
||||
inited = true;
|
||||
@@ -588,6 +619,7 @@
|
||||
bindRollLegsUI();
|
||||
bindMarket("calc-trend");
|
||||
bindMarket("calc-roll");
|
||||
bindCalcTabs();
|
||||
const refreshBtn = $("calc-btn-refresh");
|
||||
if (refreshBtn) {
|
||||
refreshBtn.addEventListener("click", function () {
|
||||
|
||||
Reference in New Issue
Block a user