Restructure live order form into labeled rows for clearer hierarchy.
Group policy selects, SL/RR fields, options, and submit so the unlabeled RR input and scrambled checkbox/price row no longer fight for space. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1279,6 +1279,12 @@ if(fullMarginEl){
|
||||
}
|
||||
|
||||
const sltpModeEl = document.getElementById("sltp-mode");
|
||||
function setOmFieldVisible(inputEl, show){
|
||||
if(!inputEl) return;
|
||||
inputEl.style.display = show ? "" : "none";
|
||||
const wrap = inputEl.closest(".om-field");
|
||||
if(wrap) wrap.style.display = show ? "" : "none";
|
||||
}
|
||||
function toggleSltpMode(){
|
||||
const mode = sltpModeEl ? sltpModeEl.value : "fixed_rr";
|
||||
const slEl = document.getElementById("order-sl");
|
||||
@@ -1289,14 +1295,14 @@ function toggleSltpMode(){
|
||||
if(!slEl || !tpEl || !slPctEl || !tpPctEl){ return; }
|
||||
const pct = mode === "pct";
|
||||
const fixed = mode === "fixed_rr";
|
||||
slEl.style.display = pct ? "none" : "";
|
||||
tpEl.style.display = (pct || fixed) ? "none" : "";
|
||||
if(fixedRrEl) fixedRrEl.style.display = fixed ? "" : "none";
|
||||
setOmFieldVisible(slEl, !pct);
|
||||
setOmFieldVisible(tpEl, !(pct || fixed));
|
||||
setOmFieldVisible(fixedRrEl, fixed);
|
||||
slEl.required = !pct;
|
||||
tpEl.required = !pct && !fixed;
|
||||
if(fixedRrEl) fixedRrEl.required = fixed;
|
||||
slPctEl.style.display = pct ? "" : "none";
|
||||
tpPctEl.style.display = pct ? "" : "none";
|
||||
setOmFieldVisible(slPctEl, pct);
|
||||
setOmFieldVisible(tpPctEl, pct);
|
||||
slPctEl.required = pct;
|
||||
tpPctEl.required = pct;
|
||||
refreshOrderTpPreview();
|
||||
|
||||
Reference in New Issue
Block a user