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:
@@ -1168,6 +1168,30 @@
|
||||
elFsExchange.value = elExchange.value;
|
||||
}
|
||||
|
||||
function unlockMarketFsOrientation() {
|
||||
try {
|
||||
if (screen.orientation && typeof screen.orientation.unlock === "function") {
|
||||
screen.orientation.unlock();
|
||||
}
|
||||
} catch (e) {
|
||||
/* ignore */
|
||||
}
|
||||
document.body.classList.remove("market-fs-want-landscape");
|
||||
}
|
||||
|
||||
function lockMarketFsLandscape() {
|
||||
document.body.classList.add("market-fs-want-landscape");
|
||||
const orient = screen.orientation;
|
||||
if (!orient || typeof orient.lock !== "function") return;
|
||||
Promise.resolve(orient.lock("landscape"))
|
||||
.catch(function () {
|
||||
return orient.lock("landscape-primary");
|
||||
})
|
||||
.catch(function () {
|
||||
/* 浏览器可能拒绝;CSS 会提示转横屏 */
|
||||
});
|
||||
}
|
||||
|
||||
function setChartFullscreen(on) {
|
||||
chartFullscreen = !!on;
|
||||
const wrap = elChartWrap || (chartHost && chartHost.closest(".market-chart-wrap"));
|
||||
@@ -1183,6 +1207,12 @@
|
||||
if (chartFullscreen) {
|
||||
populateFsExchangeOptions();
|
||||
syncFsToolbarFromMain();
|
||||
// 手机全屏优先横屏看图;电脑/平板不强制
|
||||
if (window.matchMedia && window.matchMedia("(max-width: 720px)").matches) {
|
||||
lockMarketFsLandscape();
|
||||
}
|
||||
} else {
|
||||
unlockMarketFsOrientation();
|
||||
}
|
||||
scheduleChartResize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user