fix(project): stop quarter reveal numeric drift
This commit is contained in:
+4
-14
@@ -2145,8 +2145,8 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
|
||||
|
||||
/* 가로·세로 스크롤은 이 칸 하나가 맡고, 머리 줄과 왼쪽 두 칸(구분·항목)은 붙어 있다 */
|
||||
.pj-goal-pane { flex: 1 1 auto; min-height: 0; overflow: auto; }
|
||||
/* width: 1px — table-layout: fixed 는 표 너비가 auto 가 아닐 때만 먹는다. 표는 칸 너비 합만큼 늘어나고,
|
||||
칸 너비가 머리 칸 width 로만 정해져야 분기 접기 애니메이션이 양방향으로 부드럽다(auto 면 펼 때 한 번에 튄다). */
|
||||
/* width: 1px — table-layout: fixed 는 표 너비가 auto 가 아닐 때만 먹는다.
|
||||
표는 머리 칸에 지정한 너비 합만큼 늘어나며, 분기를 펼쳐도 저장된 열 너비를 유지한다. */
|
||||
.pj-goal-table {
|
||||
width: 1px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--pj-text-size);
|
||||
color: var(--pj-ink); background: #fff; border: 1px solid #dfe2e6; border-radius: 10px; line-height: var(--pj-text-leading);
|
||||
@@ -2185,7 +2185,7 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
|
||||
content: ""; position: absolute; top: 6px; bottom: 6px; left: 3px; width: 2px; border-radius: 2px; background: transparent;
|
||||
}
|
||||
.pj-goal-colresize:hover::after, .pj-goal-colresize.is-dragging::after { background: var(--pj-accent); }
|
||||
/* 월 칸은 overflow: hidden(접기 애니메이션)이라 칸 밖으로 나간 손잡이가 잘린다 — 칸 안쪽 오른쪽 끝에 둔다 */
|
||||
/* 월 칸은 overflow: hidden 이라 칸 밖으로 나간 손잡이가 잘린다 — 칸 안쪽 오른쪽 끝에 둔다 */
|
||||
:where(.pj-goal-table th, .pj-goal-table td) { position: relative; }
|
||||
.pj-goal-table :is(th, td).pj-goal-m .pj-goal-colresize { right: 0; width: 7px; }
|
||||
.pj-goal-table :is(th, td).pj-goal-m .pj-goal-colresize::after { left: auto; right: 1px; }
|
||||
@@ -2321,18 +2321,8 @@ html.pj-goal-selecting .pj-goal-menu-btn { pointer-events: none; }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.pj-goal-fold-ic, .pj-goal-fold-v { transition: none; }
|
||||
}
|
||||
/* 접기 애니메이션 — 월 칸 너비를 0 으로(.is-shrunk) 줄인 뒤 숨김(.is-gone), 펼 땐 거꾸로(initGoals applyFold).
|
||||
줄어드는 동안 칸 안 글이 다시 줄바꿈돼 줄 높이가 출렁이지 않게 안쪽 내용은 원래 폭(--fold-w = 걸친 월 너비 합)으로 고정해 잘라 낸다. */
|
||||
/* 분기 월 열은 즉시 표시/숨김 — 너비 전환에 따른 숫자 이동·글 재줄바꿈을 방지한다. */
|
||||
.pj-goal-table .pj-goal-m { overflow: hidden; }
|
||||
.pj-goal-table.is-folding .pj-goal-m {
|
||||
transition: width .32s ease, min-width .32s ease, max-width .32s ease,
|
||||
padding .32s ease, border-right-width .32s ease;
|
||||
}
|
||||
.pj-goal-table.is-folding td.pj-goal-m > * { width: var(--fold-w, calc(85px * var(--span, 1) - 1px)); }
|
||||
.pj-goal-table thead th.pj-goal-m.is-shrunk,
|
||||
.pj-goal-table td.pj-goal-m.is-shrunk {
|
||||
width: 0; min-width: 0; max-width: 0; padding-left: 0 !important; padding-right: 0 !important; border-right-width: 0;
|
||||
}
|
||||
.pj-goal-table .pj-goal-m.is-gone { display: none; }
|
||||
|
||||
/* 영역·줄 이름 — 눌러서 그 자리에서 수정(관리자) */
|
||||
|
||||
+9
-37
@@ -8636,13 +8636,6 @@
|
||||
table.querySelectorAll("thead th[data-col]").forEach(function (th) {
|
||||
th.style.setProperty("--cw", colW[th.dataset.col] + "px");
|
||||
});
|
||||
// 분기 접기 애니메이션 동안 월 칸 안 내용을 고정할 폭(병합 칸 = 걸친 월 너비 합, 오른쪽 테두리 1px 빼고)
|
||||
table.querySelectorAll("td.pj-goal-m[data-month]").forEach(function (td) {
|
||||
const m = parseInt(td.dataset.month, 10), span = parseInt(td.dataset.span || "1", 10);
|
||||
let w = 0;
|
||||
for (let i = m; i < m + span; i++) w += colW["m" + i] || 85;
|
||||
td.style.setProperty("--fold-w", (w - 1) + "px");
|
||||
});
|
||||
}
|
||||
applyColW();
|
||||
let lastColResize = 0;
|
||||
@@ -8692,7 +8685,7 @@
|
||||
});
|
||||
[copy].concat(Array.from(copy.querySelectorAll("*"))).forEach(function (n) {
|
||||
n.removeAttribute("id"); n.removeAttribute("contenteditable"); n.removeAttribute("data-placeholder");
|
||||
n.classList.remove("is-shrunk", "is-gone");
|
||||
n.classList.remove("is-gone");
|
||||
const overrides = { position: "static", width: "max-content", "min-width": "0", "max-width": "none",
|
||||
height: "auto", overflow: "visible", transition: "none", "overflow-wrap": "normal", "word-break": "normal" };
|
||||
Object.keys(overrides).forEach(function (p) { n.style.setProperty(p, overrides[p], "important"); });
|
||||
@@ -8903,18 +8896,16 @@
|
||||
recompute();
|
||||
|
||||
// ── 분기 접기 — 분기 칸 머리의 버튼이 그 분기 월 칸(.pj-goal-m[data-h], 1~4)을 접었다 편다.
|
||||
// 칸 너비를 0 으로 줄이는 애니메이션(.is-shrunk, CSS transition) 뒤 display:none(.is-gone),
|
||||
// 펼 때는 거꾸로. 상태는 브라우저에 기억(localStorage pj_goal_fold_q — 반기 때 키 pj_goal_fold 와 따로).
|
||||
// 월 칸은 즉시 숨기거나 원래 너비로 표시한다. 너비 애니메이션 중 숫자가 밀리는 현상을 막는다.
|
||||
// 상태는 브라우저에 기억(localStorage pj_goal_fold_q — 반기 때 키 pj_goal_fold 와 따로).
|
||||
// 보기만 하는 사람도 쓸 수 있다.
|
||||
const FOLD_KEY = "pj_goal_fold_q";
|
||||
const FOLD_MS = 320;
|
||||
const QUARTERS = [1, 2, 3, 4];
|
||||
const fold = { 1: false, 2: false, 3: false, 4: false };
|
||||
try {
|
||||
const saved = JSON.parse(localStorage.getItem(FOLD_KEY) || "null");
|
||||
if (saved) QUARTERS.forEach(function (q) { fold[q] = !!saved[q]; });
|
||||
} catch (_) {}
|
||||
const foldTimers = {};
|
||||
function halfCells(h) { return table.querySelectorAll('.pj-goal-m[data-h="' + h + '"]'); }
|
||||
function syncFoldBtn(h) {
|
||||
const btn = table.querySelector('.pj-goal-fold[data-h="' + h + '"]');
|
||||
@@ -8930,31 +8921,12 @@
|
||||
delete th.dataset.tip;
|
||||
}
|
||||
}
|
||||
function applyFold(h, animate) {
|
||||
function applyFold(h) {
|
||||
const cells = halfCells(h);
|
||||
const folded = fold[h];
|
||||
clearTimeout(foldTimers[h]);
|
||||
const reduce = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
||||
syncFoldBtn(h);
|
||||
if (!animate || reduce) {
|
||||
cells.forEach(function (c) { c.classList.toggle("is-shrunk", folded); c.classList.toggle("is-gone", folded); });
|
||||
if (!folded) table.querySelectorAll('.pj-goal-m[data-h="' + h + '"] .pj-goal-text').forEach(fit);
|
||||
return;
|
||||
}
|
||||
table.classList.add("is-folding");
|
||||
if (folded) {
|
||||
cells.forEach(function (c) { c.classList.add("is-shrunk"); });
|
||||
} else {
|
||||
cells.forEach(function (c) { c.classList.remove("is-gone"); });
|
||||
void table.offsetWidth; // 너비 0 인 채로 한 번 그린 뒤 원래 너비로 늘린다
|
||||
cells.forEach(function (c) { c.classList.remove("is-shrunk"); });
|
||||
}
|
||||
foldTimers[h] = setTimeout(function () {
|
||||
if (folded) cells.forEach(function (c) { c.classList.add("is-gone"); });
|
||||
else table.querySelectorAll('.pj-goal-m[data-h="' + h + '"] .pj-goal-text').forEach(fit);
|
||||
delete foldTimers[h];
|
||||
if (!Object.keys(foldTimers).length) table.classList.remove("is-folding");
|
||||
}, FOLD_MS + 20);
|
||||
cells.forEach(function (c) { c.classList.toggle("is-gone", folded); });
|
||||
if (!folded) table.querySelectorAll('.pj-goal-m[data-h="' + h + '"] .pj-goal-text').forEach(fit);
|
||||
}
|
||||
// 분기 머리 칸 아무 곳이나 누르면 접기/펴기(버튼만이 아니라). 너비 조절 손잡이를 끈 뒤의 클릭은 무시.
|
||||
table.querySelectorAll("thead th.pj-goal-fold-th").forEach(function (th) {
|
||||
@@ -8967,7 +8939,7 @@
|
||||
fold[h] = !fold[h];
|
||||
try { localStorage.setItem(FOLD_KEY, JSON.stringify(fold)); } catch (_) {}
|
||||
clearMergeSel();
|
||||
applyFold(h, true);
|
||||
applyFold(h);
|
||||
});
|
||||
});
|
||||
// contenteditable 글 칸은 내용의 자연 높이를 쓴다. 표가 가장 높은 칸에 행을 맞추고
|
||||
@@ -8980,7 +8952,7 @@
|
||||
ta.style.height = ta.scrollHeight + "px";
|
||||
}
|
||||
function fitAll() { table.querySelectorAll(".pj-goal-text").forEach(fit); }
|
||||
QUARTERS.forEach(function (q) { applyFold(q, false); });
|
||||
QUARTERS.forEach(applyFold);
|
||||
|
||||
// 병합 선택(Shift+클릭) — 관리자 전용, 아래에서 채운다. 접기 버튼이 먼저 부르므로 여기 둔다.
|
||||
let clearMergeSel = function () {};
|
||||
@@ -9342,7 +9314,7 @@
|
||||
textSaver.prune();
|
||||
addColHandles();
|
||||
applyColW();
|
||||
QUARTERS.forEach(function (q) { applyFold(q, false); });
|
||||
QUARTERS.forEach(applyFold);
|
||||
bindTexts(table);
|
||||
if (!reduce) {
|
||||
table.querySelectorAll("tbody.pj-goal-area > tr[data-row-id]").forEach(function (tr) {
|
||||
|
||||
Reference in New Issue
Block a user