feat(project): 연간 목표 — 연간 열 90px, 머리·이름 가운데 정렬, 이름 칸 너비 조절·기억
- 연간 열 너비 90px 고정 - 맨 위 머리 줄과 왼쪽 이름 두 칸(구분·항목) 가운데 정렬 - 이름 두 칸은 머리 칸 오른쪽 끝을 끌어 너비 조절(48~320px, 더블클릭 = 기본 72px), 브라우저에 기억(localStorage pj_goal_col_w) - project.js/css 캐시 버전 20260930c Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7460,6 +7460,55 @@
|
||||
const year = table.dataset.year;
|
||||
const isAdmin = table.dataset.admin === "true";
|
||||
|
||||
// ── 왼쪽 이름 두 칸(구분·항목) 너비 — 머리 칸 오른쪽 끝을 끌어 조절, 브라우저에 기억 ──
|
||||
// 화면 배율(uiZoom) 안이라 마우스 이동 거리는 배율로 나눈다.
|
||||
const COL_KEY = "pj_goal_col_w";
|
||||
const COL_MIN = 48, COL_MAX = 320;
|
||||
const colW = { c1: 72, c2: 72 };
|
||||
try {
|
||||
const saved = JSON.parse(localStorage.getItem(COL_KEY) || "null");
|
||||
if (saved) ["c1", "c2"].forEach(function (k) {
|
||||
const v = parseInt(saved[k], 10);
|
||||
if (v) colW[k] = Math.min(COL_MAX, Math.max(COL_MIN, v));
|
||||
});
|
||||
} catch (_) {}
|
||||
function applyColW() {
|
||||
table.style.setProperty("--goal-c1-w", colW.c1 + "px");
|
||||
table.style.setProperty("--goal-c2-w", colW.c2 + "px");
|
||||
}
|
||||
applyColW();
|
||||
table.querySelectorAll(".pj-goal-colresize").forEach(function (h) {
|
||||
h.addEventListener("mousedown", function (e) {
|
||||
if (e.button !== 0) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const key = h.dataset.col;
|
||||
const startX = e.clientX, startW = colW[key];
|
||||
h.classList.add("is-dragging");
|
||||
document.documentElement.classList.add("pj-goal-resizing");
|
||||
function onMove(ev) {
|
||||
const w = Math.round(startW + (ev.clientX - startX) / uiZoom());
|
||||
colW[key] = Math.min(COL_MAX, Math.max(COL_MIN, w));
|
||||
applyColW();
|
||||
}
|
||||
function onUp() {
|
||||
document.removeEventListener("mousemove", onMove);
|
||||
document.removeEventListener("mouseup", onUp);
|
||||
h.classList.remove("is-dragging");
|
||||
document.documentElement.classList.remove("pj-goal-resizing");
|
||||
try { localStorage.setItem(COL_KEY, JSON.stringify(colW)); } catch (_) {}
|
||||
}
|
||||
document.addEventListener("mousemove", onMove);
|
||||
document.addEventListener("mouseup", onUp);
|
||||
});
|
||||
// 두 번 누르면 기본 너비(72px)로
|
||||
h.addEventListener("dblclick", function () {
|
||||
colW[h.dataset.col] = 72;
|
||||
applyColW();
|
||||
try { localStorage.setItem(COL_KEY, JSON.stringify(colW)); } catch (_) {}
|
||||
});
|
||||
});
|
||||
|
||||
// ── 합계·달성률 ──
|
||||
function numOf(node) {
|
||||
const raw = (node.tagName === "INPUT" ? node.value : node.textContent) || "";
|
||||
|
||||
Reference in New Issue
Block a user