Auto-size hub order popup iframe so trade form shows without scrollbars.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,24 +1,14 @@
|
||||
/* 中控弹窗 iframe:仅保留实盘下单表单区 */
|
||||
/* 中控弹窗 iframe:紧凑表单,无内部滚动条 */
|
||||
html:has(body[data-order-popup="1"]),
|
||||
body[data-order-popup="1"] {
|
||||
overflow-x: hidden;
|
||||
overflow: hidden !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] .container.embed-order-popup-shell {
|
||||
max-width: 100%;
|
||||
padding: 10px 12px 16px;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] .embed-order-popup-head {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] .embed-order-popup-head h1 {
|
||||
font-size: 1rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] .header-row {
|
||||
margin-top: 6px;
|
||||
padding: 8px 10px 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] .embed-order-popup-hide {
|
||||
@@ -32,12 +22,35 @@ body[data-order-popup="1"] .order-popup-trade-grid {
|
||||
|
||||
body[data-order-popup="1"] .order-popup-form-card {
|
||||
margin: 0;
|
||||
padding: 10px 12px 12px;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] .order-popup-form-card h2 {
|
||||
font-size: 0.95rem;
|
||||
body[data-order-popup="1"] .order-popup-form-card .tip-collapse {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] .order-popup-form-card > div:first-child span.btn-del {
|
||||
display: none;
|
||||
body[data-order-popup="1"] .order-popup-form-card .tip-collapse-summary {
|
||||
padding: 6px 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] #add-order-form {
|
||||
gap: 6px 8px;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] #add-order-form input,
|
||||
body[data-order-popup="1"] #add-order-form select,
|
||||
body[data-order-popup="1"] #add-order-form button[type="submit"] {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] #add-order-form label,
|
||||
body[data-order-popup="1"] #add-order-form > span {
|
||||
font-size: 0.78rem !important;
|
||||
}
|
||||
|
||||
body[data-order-popup="1"] .order-plan-preview-bar {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,22 @@
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
function reportOrderPopupSize() {
|
||||
if (!isOrderPopup()) return;
|
||||
const root = document.querySelector(".embed-order-popup-shell") || document.body;
|
||||
const h = Math.ceil(
|
||||
Math.max(
|
||||
root.scrollHeight,
|
||||
root.offsetHeight,
|
||||
document.documentElement.scrollHeight,
|
||||
document.body.scrollHeight
|
||||
)
|
||||
);
|
||||
try {
|
||||
window.parent.postMessage({ type: "hub-order-popup-resize", height: h }, "*");
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
function prefillOrderSymbolFromQuery() {
|
||||
if (!isOrderPopup()) return;
|
||||
let sym = "";
|
||||
@@ -109,6 +125,7 @@
|
||||
if (typeof global.refreshPriceSnapshotConditional === "function") {
|
||||
global.refreshPriceSnapshotConditional();
|
||||
}
|
||||
reportOrderPopupSize();
|
||||
}
|
||||
|
||||
function injectFragment(html) {
|
||||
@@ -280,6 +297,17 @@
|
||||
patchHardNavigations();
|
||||
bindNav();
|
||||
runPageInit(getTab());
|
||||
reportOrderPopupSize();
|
||||
if (isOrderPopup()) {
|
||||
window.setTimeout(reportOrderPopupSize, 120);
|
||||
window.setTimeout(reportOrderPopupSize, 450);
|
||||
if (typeof ResizeObserver !== "undefined") {
|
||||
const root = document.querySelector(".embed-order-popup-shell") || document.body;
|
||||
try {
|
||||
new ResizeObserver(() => reportOrderPopupSize()).observe(root);
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
try {
|
||||
window.parent.postMessage({ type: "instance-frame-ready" }, "*");
|
||||
} catch (_) {}
|
||||
|
||||
Reference in New Issue
Block a user