fix(cupang): 접힌 레이아웃에서 스크롤 영역 높이가 160px 로 잘리던 문제
3열이 접혀 ③ 카드가 둘째 줄로 내려가면 (창높이 − 요소top) 이 음수가 되어 최소값 160px 로 고정됐다. 260px 이하면 창 높이의 60% 를 쓰도록 바꾸고, 페이지 스크롤 시에도 높이를 다시 계산한다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1078,7 +1078,10 @@
|
|||||||
panes.forEach(function (el) {
|
panes.forEach(function (el) {
|
||||||
if (!el) return;
|
if (!el) return;
|
||||||
var top = el.getBoundingClientRect().top;
|
var top = el.getBoundingClientRect().top;
|
||||||
var h = Math.max(160, window.innerHeight - top - 24);
|
var avail = window.innerHeight - top - 24;
|
||||||
|
// 화면 아래로 내려가 있는(3열이 접힌) 영역은 창 높이의 60% 를 쓴다.
|
||||||
|
// 그대로 두면 음수가 되어 아주 작은 높이로 잘린다.
|
||||||
|
var h = avail > 260 ? avail : Math.round(window.innerHeight * 0.6);
|
||||||
// !important 로 박아 넣는다 — 다른 규칙에 밀리지 않게
|
// !important 로 박아 넣는다 — 다른 규칙에 밀리지 않게
|
||||||
el.style.setProperty("max-height", h + "px", "important");
|
el.style.setProperty("max-height", h + "px", "important");
|
||||||
el.style.setProperty("overflow-y", "auto", "important");
|
el.style.setProperty("overflow-y", "auto", "important");
|
||||||
@@ -1088,6 +1091,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("resize", fitScrollAreas);
|
window.addEventListener("resize", fitScrollAreas);
|
||||||
|
var pageScroller = document.querySelector(".erp-page");
|
||||||
|
if (pageScroller) pageScroller.addEventListener("scroll", fitScrollAreas, { passive: true });
|
||||||
|
|
||||||
function render() { renderSummary(); renderDist(); fitScrollAreas(); }
|
function render() { renderSummary(); renderDist(); fitScrollAreas(); }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user