feat(performance): 기간 빠른 선택 이번달·올해만(기본 이번달) · 일자별 표 제목·기간 합계 행 스크롤 고정
- 매출 실적·광고비 탭 오늘·이번주 버튼 삭제, 매출 실적 기본 기간 = 이번달 - 일자별 표 상자(.perf-main-wrap)를 화면 높이로 묶어 상자 안 세로 스크롤 — 제목 행 + 맨 위 기간 합계 행 sticky (합계 행 top = 제목 행 높이 --perf-head-h, stickyHead 가 ResizeObserver 로 잼), 날짜 열 가로 고정은 그대로 - 테스트: perf_sticky.browser.test.js(실제 브라우저), test_ad_spend 빠른 선택 순서 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1434,9 +1434,22 @@
|
||||
});
|
||||
}
|
||||
|
||||
// 일자별 표 스크롤 고정(2026-10-26) — 기간 합계 행이 제목 행 바로 밑에 붙도록 제목 행 높이를 CSS 변수로.
|
||||
// 그룹 접기·화면 크기·글꼴에 따라 높이가 바뀌므로 ResizeObserver 로 다시 잰다.
|
||||
function stickyHead(root) {
|
||||
root.querySelectorAll(".perf-main-wrap").forEach(function (wrap) {
|
||||
const head = wrap.querySelector("thead");
|
||||
if (!head) return;
|
||||
const measure = function () { wrap.style.setProperty("--perf-head-h", head.getBoundingClientRect().height + "px"); };
|
||||
measure();
|
||||
if (window.ResizeObserver) new ResizeObserver(measure).observe(head);
|
||||
else window.addEventListener("resize", measure);
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const dash = document.getElementById("perf-dash");
|
||||
if (dash) initDashboard(dash);
|
||||
if (dash) { initDashboard(dash); stickyHead(dash); }
|
||||
const set = document.getElementById("perf-settings");
|
||||
if (set) initSettings(set);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user