feat(project): add group collapse and UI polish
This commit is contained in:
@@ -104,8 +104,38 @@
|
||||
function init(table, toolbar) {
|
||||
if (!toolbar) return;
|
||||
let saved = null;
|
||||
// body 에 두어 표 스크롤과 화면 zoom 에 잘리지 않는 선택 영역 위 팝업으로 표시한다.
|
||||
document.body.appendChild(toolbar);
|
||||
const colorButton = toolbar.querySelector("[data-goal-format='color']");
|
||||
const colorGrid = toolbar.querySelector(".pj-goal-color-grid");
|
||||
function closeColors() { colorGrid.hidden = true; colorButton.setAttribute("aria-expanded", "false"); }
|
||||
function showColor(value) {
|
||||
colorButton.querySelector(".pj-goal-color-preview").style.backgroundColor = value;
|
||||
colorGrid.querySelectorAll("[data-goal-color]").forEach(function (btn) {
|
||||
btn.setAttribute("aria-pressed", String(btn.dataset.goalColor.toLowerCase() === value.toLowerCase()));
|
||||
});
|
||||
}
|
||||
function place() {
|
||||
if (!saved || !saved.editor.isConnected) { clear(); return; }
|
||||
const sel = window.getSelection();
|
||||
if (!sel.rangeCount || sel.isCollapsed || !saved.editor.contains(sel.getRangeAt(0).commonAncestorContainer)) return;
|
||||
const range = sel.getRangeAt(0);
|
||||
if (!range.getBoundingClientRect) return; // DOM 테스트 환경에는 레이아웃이 없다.
|
||||
const rects = range.getClientRects();
|
||||
const rect = rects.length ? rects[0] : range.getBoundingClientRect();
|
||||
const paneRect = table.parentElement.getBoundingClientRect();
|
||||
if (rect.bottom < paneRect.top || rect.top > paneRect.bottom || rect.right < paneRect.left || rect.left > paneRect.right) {
|
||||
toolbar.hidden = true; closeColors(); return;
|
||||
}
|
||||
toolbar.hidden = false;
|
||||
const w = toolbar.offsetWidth, h = toolbar.offsetHeight;
|
||||
toolbar.style.left = Math.max(8, Math.min(rect.left + rect.width / 2 - w / 2, window.innerWidth - w - 8)) + "px";
|
||||
toolbar.style.top = Math.max(8, rect.top - h - 8) + "px";
|
||||
colorGrid.classList.toggle("is-below", rect.top - h - 88 < 8);
|
||||
}
|
||||
function clear() {
|
||||
saved = null;
|
||||
toolbar.hidden = true; closeColors();
|
||||
toolbar.querySelectorAll("button, input, select").forEach(function (el) { el.disabled = true; });
|
||||
}
|
||||
function capture() {
|
||||
@@ -130,8 +160,10 @@
|
||||
return chosen.every(function (r) { return r[key] === value; }) && value !== undefined ? value : fallback;
|
||||
}
|
||||
toolbar.querySelector("[data-goal-format='bold']").value = uniform("bold", false) ? "700" : "400";
|
||||
toolbar.querySelector("[data-goal-format='color']").value = uniform("color", "#1e1f21");
|
||||
showColor(uniform("color", "#000000"));
|
||||
toolbar.querySelector("[data-goal-format='size']").value = String(uniform("size", 14));
|
||||
toolbar.hidden = false;
|
||||
place();
|
||||
}
|
||||
document.addEventListener("selectionchange", capture);
|
||||
table.addEventListener("mouseup", capture);
|
||||
@@ -156,8 +188,17 @@
|
||||
});
|
||||
paint(editor, compact(out)); editor.focus(); restore(editor, saved.start, saved.end);
|
||||
editor.dispatchEvent(new Event("input", { bubbles: true }));
|
||||
capture();
|
||||
}
|
||||
toolbar.querySelector("[data-goal-format='color']").addEventListener("input", function (e) { apply("color", e.target.value); });
|
||||
colorButton.addEventListener("click", function () {
|
||||
colorGrid.hidden = !colorGrid.hidden;
|
||||
colorButton.setAttribute("aria-expanded", String(!colorGrid.hidden));
|
||||
});
|
||||
colorGrid.addEventListener("click", function (e) {
|
||||
const btn = e.target.closest("[data-goal-color]");
|
||||
if (!btn) return;
|
||||
apply("color", btn.dataset.goalColor.toLowerCase()); closeColors();
|
||||
});
|
||||
toolbar.querySelector("[data-goal-format='bold']").addEventListener("change", function (e) { apply("bold", e.target.value === "700"); });
|
||||
toolbar.querySelector("[data-goal-format='size']").addEventListener("change", function (e) { apply("size", Number(e.target.value)); });
|
||||
toolbar.querySelector("[data-goal-format='reset']").addEventListener("click", function () { apply("reset"); });
|
||||
@@ -165,6 +206,16 @@
|
||||
if (toolbar.contains(e.target) || (saved && saved.editor.contains(e.target))) return;
|
||||
clear();
|
||||
}, true);
|
||||
toolbar.addEventListener("keydown", function (e) {
|
||||
if (e.key !== "Escape") return;
|
||||
e.preventDefault(); e.stopPropagation();
|
||||
if (!colorGrid.hidden) { closeColors(); colorButton.focus(); }
|
||||
else { if (saved) saved.editor.focus(); clear(); }
|
||||
});
|
||||
window.addEventListener("resize", place);
|
||||
window.addEventListener("scroll", function (e) { if (!toolbar.contains(e.target)) place(); }, true);
|
||||
new MutationObserver(function () { if (saved && !saved.editor.isConnected) clear(); }).observe(table, { childList: true, subtree: true });
|
||||
clear();
|
||||
}
|
||||
window.PJGoalText = { attach: attach, init: init, readRuns: readRuns, paint: paint, encode: encode };
|
||||
})();
|
||||
|
||||
+40
-12
@@ -95,7 +95,8 @@
|
||||
뷰포트보다 48px 넓어진다. 그러면 우측 "내 업무" 패널의 오른쪽 끝(=스크롤
|
||||
막대 자리)이 화면 밖으로 밀려나 막대가 절대 안 보인다(헤드리스 크롬 좌표
|
||||
덤프로 확인: 패널 right=1917 > viewport 1911). */
|
||||
.erp-page:has(> .pj-wrap) { max-width: none; box-sizing: border-box; }
|
||||
.erp-page:has(> .pj-wrap) { max-width: none; box-sizing: border-box; padding-left: 8px; padding-right: 8px; }
|
||||
.erp-page > .pj-wrap { padding-left: 0; padding-right: 0; }
|
||||
.pj-project-view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
||||
.pj-project-view .pj-layout { flex: 1 1 auto; min-height: 0; }
|
||||
/* grid-template-rows: minmax(0,1fr) 이 없으면 암시적 행이 "auto"(내용 크기)로
|
||||
@@ -106,9 +107,12 @@
|
||||
/* 우측에 항상 떠 있던 "내 업무" 칸은 없앴다 — 좌측 사이드바의 접이식
|
||||
"내 업무" 메뉴(.pj-mytasks-panel)가 그 역할을 대신한다. 그래서 2열. */
|
||||
.pj-layout {
|
||||
display: grid; grid-template-columns: 250px 1fr; grid-template-rows: minmax(0, 1fr);
|
||||
gap: 22px; height: 100%; min-height: 0; align-items: stretch;
|
||||
position: relative; display: grid; grid-template-columns: var(--pj-side-w, 250px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
|
||||
gap: 8px; height: 100%; min-height: 0; align-items: stretch;
|
||||
}
|
||||
.pj-side-resizer { position: absolute; top: 0; bottom: 0; left: var(--pj-side-w, 250px); width: 8px; padding: 0; border: 0; background: transparent; cursor: col-resize; z-index: 12; }
|
||||
.pj-side-resizer:hover, .pj-side-resizer:focus-visible, .pj-side-resizer.is-dragging { background: var(--pj-accent-tint); outline: none; }
|
||||
html.pj-side-resizing, html.pj-side-resizing * { cursor: col-resize !important; user-select: none !important; }
|
||||
.pj-side { min-width: 0; min-height: 0; height: 100%; overflow-y: auto; padding-right: 14px; }
|
||||
.pj-main { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; }
|
||||
|
||||
@@ -131,12 +135,14 @@
|
||||
.pj-vbar-thumb:hover, .pj-vbar-thumb.is-dragging { background: #8f949e; }
|
||||
.pj-vbar-thumb.is-dragging { cursor: grabbing; }
|
||||
@media (max-width: 1280px) {
|
||||
.pj-layout { grid-template-columns: 220px 1fr; }
|
||||
.pj-layout { grid-template-columns: var(--pj-side-w, 220px) minmax(0, 1fr); }
|
||||
.pj-side-resizer { left: var(--pj-side-w, 220px); }
|
||||
}
|
||||
@media (max-width: 900px) {
|
||||
.erp-page:has(> .pj-wrap) { max-width: 1550px; }
|
||||
.erp-page > .pj-wrap.pj-project-view { display: block; }
|
||||
.pj-layout { display: block; height: auto; }
|
||||
.pj-side-resizer { display: none; }
|
||||
.pj-side, .pj-main { height: auto; overflow: visible; }
|
||||
}
|
||||
|
||||
@@ -360,6 +366,19 @@
|
||||
.pj-col-actions .pj-icon-btn { width: 28px; height: 28px; color: var(--pj-ink-soft); }
|
||||
.pj-col-actions .pj-icon-btn .material-symbols-outlined { font-size: 20px; }
|
||||
.pj-col-actions .pj-icon-btn:hover { color: var(--pj-ink); background: rgba(0,0,0,.06); }
|
||||
.pj-col-collapse svg { width: 18px; height: 18px; }
|
||||
.pj-col.is-collapsed { flex-basis: 48px; width: 48px; padding: 0; }
|
||||
.pj-col.is-collapsed .pj-col-head { flex-direction: column; gap: 10px; padding: 10px 8px; margin: 0; border: 0; border-radius: 5px; }
|
||||
.pj-col.is-collapsed .pj-col-name { writing-mode: vertical-rl; text-orientation: mixed; overflow-wrap: anywhere; max-height: 240px; }
|
||||
.pj-col.is-collapsed .pj-col-count { writing-mode: vertical-rl; }
|
||||
.pj-col.is-collapsed .pj-col-body,
|
||||
.pj-col.is-collapsed .pj-col-addtask,
|
||||
.pj-col.is-collapsed .pj-col-assignee,
|
||||
.pj-col.is-collapsed .pj-chip,
|
||||
.pj-col.is-collapsed .pj-col-actions > :not(.pj-col-collapse) { display: none; }
|
||||
.pj-col.is-collapsed .pj-col-head.pj-col-head-colored { margin: 0; }
|
||||
.pj-col.is-collapsed .pj-col-actions { order: -1; margin: 0; }
|
||||
.pj-col.is-collapsed .pj-col-collapse svg { transform: rotate(180deg); }
|
||||
/* 컬럼 안의 카드가 많아지면 보드 전체가 아니라 이 컬럼만 세로로 스크롤한다
|
||||
— 그래야 가로로 늘어난 다른 세션들이 화면 밖으로 밀려나지 않는다. */
|
||||
.pj-col-body {
|
||||
@@ -937,10 +956,10 @@ html.pj-ui-scale #pj-timeline { zoom: calc(1 / var(--pj-z)); --tz: var(--pj-z);
|
||||
.pj-comment-body a:hover, .pj-chat-bubble a:hover { color: #0b3f99; }
|
||||
.pj-comment-form { display: flex; align-items: center; gap: 6px; }
|
||||
.pj-comment-form input { flex: 1; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: var(--pj-text-size); font-family: inherit; box-sizing: border-box; line-height: var(--pj-text-leading); font-weight: 400; }
|
||||
/* 댓글·답글 여러 줄 입력칸 — Enter 등록 · Shift+Enter 줄바꿈, 글 줄 수만큼 늘어남(project.js fitComposer, 최대 160px) */
|
||||
/* 댓글·답글 입력칸은 70px 고정, 긴 글은 칸 안에서 스크롤한다. */
|
||||
.pj-comment-form textarea.pj-composer-ta {
|
||||
flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid #d8dce2; border-radius: 8px; font-size: var(--pj-text-size); font-family: inherit;
|
||||
line-height: var(--pj-text-leading); box-sizing: border-box; resize: none; overflow-y: hidden; max-height: 160px; align-self: center; font-weight: 400;
|
||||
line-height: var(--pj-text-leading); box-sizing: border-box; resize: none; overflow-y: auto; height: 70px; min-height: 70px; max-height: 70px; align-self: center; font-weight: 400;
|
||||
}
|
||||
.pj-comment-form textarea.pj-composer-ta:focus { outline: none; border-color: #a9aeb6; }
|
||||
.pj-comment-acts { display: inline-flex; gap: 1px; flex: 0 0 auto; }
|
||||
@@ -1583,7 +1602,8 @@ img.pj-person-ic { width: 22px; height: 22px; }
|
||||
}
|
||||
.pj-side-navlink:hover { background: #f1f2f4; }
|
||||
.pj-side-navic { font-size: 20px; color: #5f6368; flex: 0 0 auto; }
|
||||
.pj-side-navtext { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pj-side-navtext { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pj-side-navlink { box-sizing: border-box; }
|
||||
.pj-side-navbadge {
|
||||
flex: 0 0 auto; min-width: 18px; padding: 1px 6px; border-radius: 999px;
|
||||
background: #fbe3df; color: #c22b10; font-size: 11px; font-weight: 700; text-align: center;
|
||||
@@ -2163,8 +2183,9 @@ html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
|
||||
}
|
||||
.pj-goal-colresize:hover::after, .pj-goal-colresize.is-dragging::after { background: var(--pj-accent); }
|
||||
/* 월 칸은 overflow: hidden(접기 애니메이션)이라 칸 밖으로 나간 손잡이가 잘린다 — 칸 안쪽 오른쪽 끝에 둔다 */
|
||||
.pj-goal-table thead th.pj-goal-m .pj-goal-colresize { right: 0; width: 7px; }
|
||||
.pj-goal-table thead th.pj-goal-m .pj-goal-colresize::after { left: auto; right: 1px; }
|
||||
: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; }
|
||||
html.pj-goal-resizing, html.pj-goal-resizing * { cursor: col-resize !important; user-select: none !important; }
|
||||
.pj-goal-table tbody th { padding: 7px 8px; vertical-align: middle; } /* 왼쪽 이름은 세로 가운데 */
|
||||
|
||||
@@ -2698,9 +2719,16 @@ html[data-pj-font="nanum-square-round"] { --pj-font: "NanumSquareRound", var(--p
|
||||
.pj-options-dialog p { font-size: 12px; color: var(--pj-ink-soft); }
|
||||
.pj-options-dialog .pj-options-error { color: #c22b10; }
|
||||
.pj-options-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
|
||||
.pj-goal-format { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--pj-border); background: #fff; font-size: 12px; }
|
||||
.pj-goal-format > span { color: var(--pj-ink-soft); }
|
||||
.pj-goal-format { position: fixed; z-index: 1200; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 10px; max-width: calc(100vw - 16px); box-sizing: border-box; border: 1px solid var(--pj-border); border-radius: 8px; box-shadow: 0 4px 16px #0002; background: #fff; color: var(--pj-ink); font-family: var(--pj-font); font-size: 12px; }
|
||||
.pj-goal-format[hidden], .pj-goal-color-grid[hidden] { display: none; }
|
||||
.pj-goal-format label { display: flex; align-items: center; gap: 6px; }
|
||||
.pj-goal-format select { padding: 4px; border: 1px solid #d8dce2; border-radius: 4px; font: inherit; }
|
||||
.pj-goal-format input[type="color"] { width: 30px; height: 28px; padding: 2px; border: 1px solid #d8dce2; border-radius: 4px; background: #fff; cursor: pointer; }
|
||||
.pj-goal-color-picker { position: relative; display: flex; align-items: center; gap: 6px; }
|
||||
.pj-goal-color-toggle { width: 30px; height: 28px; padding: 4px; border: 1px solid #d8dce2; border-radius: 4px; background: #fff; cursor: pointer; }
|
||||
.pj-goal-color-preview { display: block; width: 100%; height: 100%; background: #000; box-shadow: inset 0 0 0 1px #0002; }
|
||||
.pj-goal-color-grid { position: absolute; bottom: calc(100% + 8px); left: 0; display: grid; grid-template-columns: repeat(6, 26px); gap: 6px; padding: 8px; background: #fff; border: 1px solid var(--pj-border); border-radius: 6px; box-shadow: 0 4px 12px #0002; }
|
||||
.pj-goal-color-grid.is-below { bottom: auto; top: calc(100% + 8px); }
|
||||
.pj-goal-text-swatch { width: 26px; height: 26px; border: 1px solid #0003; border-radius: 3px; background: var(--swatch); cursor: pointer; padding: 0; }
|
||||
.pj-goal-text-swatch[aria-pressed="true"] { outline: 2px solid var(--pj-accent); outline-offset: 2px; }
|
||||
.pj-goal-text-swatch:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: 2px; }
|
||||
.pj-goal-format :disabled { opacity: .45; cursor: default; }
|
||||
|
||||
+118
-11
@@ -2158,13 +2158,11 @@
|
||||
try { win.focus(); } catch (_) {}
|
||||
}
|
||||
|
||||
// ── 댓글·답글 입력칸(textarea.pj-composer-ta) — 글 줄 수만큼 높이를 늘린다(최대 160px, 넘으면 칸 안 스크롤).
|
||||
// Enter = 등록, Shift+Enter = 줄바꿈(각 입력칸 keydown). 코드로 비운 뒤엔 fitComposer 를 불러 한 줄로 되돌린다.
|
||||
// ── 댓글·답글 입력칸 — 전송·붙여넣기 뒤에도 70px 고정, 긴 글은 내부 스크롤.
|
||||
function fitComposer(ta) {
|
||||
if (!ta || ta.tagName !== "TEXTAREA") return;
|
||||
ta.style.height = "auto";
|
||||
ta.style.height = Math.min(ta.scrollHeight, 160) + "px";
|
||||
ta.style.overflowY = ta.scrollHeight > 160 ? "auto" : "hidden";
|
||||
ta.style.height = "70px";
|
||||
ta.style.overflowY = "auto";
|
||||
}
|
||||
document.addEventListener("input", function (e) {
|
||||
if (e.target && e.target.classList && e.target.classList.contains("pj-composer-ta")) fitComposer(e.target);
|
||||
@@ -4165,6 +4163,40 @@
|
||||
// 섹션별 빠른 작업 입력 초안 — 보드를 다시 그려도 입력값/저장 중 상태를 유지한다.
|
||||
const boardTaskDrafts = {};
|
||||
const boardTaskOutsideDown = {};
|
||||
const BOARD_FOLD_KEY = "pj_board_fold:" + projectId;
|
||||
let boardFold = {};
|
||||
try { boardFold = JSON.parse(localStorage.getItem(BOARD_FOLD_KEY) || "{}") || {}; } catch (_) {}
|
||||
function wireBoardCollapse(col) {
|
||||
const head = col.querySelector(".pj-col-head");
|
||||
let actions = head.querySelector(".pj-col-actions");
|
||||
if (!actions) {
|
||||
actions = document.createElement("span"); actions.className = "pj-col-actions"; head.appendChild(actions);
|
||||
}
|
||||
const btn = document.createElement("button");
|
||||
btn.type = "button"; btn.className = "pj-icon-btn pj-col-collapse";
|
||||
// 아사나의 왼쪽 화살표 + 세로 경계선 모양.
|
||||
btn.innerHTML = '<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 3v14M8 6l-4 4 4 4M4 10h12"/></svg>';
|
||||
actions.prepend(btn);
|
||||
const key = colKey(col);
|
||||
function update() {
|
||||
const folded = boardFold[key] === true;
|
||||
col.classList.toggle("is-collapsed", folded);
|
||||
btn.setAttribute("aria-expanded", String(!folded));
|
||||
btn.setAttribute("aria-label", (folded ? "그룹 펼치기: " : "그룹 축소: ") + head.querySelector(".pj-col-name").textContent);
|
||||
btn.title = folded ? "그룹 펼치기" : "그룹 축소";
|
||||
btn.dataset.tip = btn.title;
|
||||
col.querySelector(".pj-col-body").inert = folded;
|
||||
}
|
||||
btn.addEventListener("mousedown", function (e) { e.stopPropagation(); });
|
||||
btn.addEventListener("dragstart", function (e) { e.preventDefault(); e.stopPropagation(); });
|
||||
btn.addEventListener("click", function (e) {
|
||||
e.stopPropagation();
|
||||
boardFold[key] = !boardFold[key];
|
||||
try { localStorage.setItem(BOARD_FOLD_KEY, JSON.stringify(boardFold)); } catch (_) {}
|
||||
update(); syncBoardHBar();
|
||||
});
|
||||
update();
|
||||
}
|
||||
function renderBoard() {
|
||||
// pj-board(바깥)는 가로 스크롤 뷰포트, pj-board-canvas(안쪽)는 세션을
|
||||
// 가로로 늘어놓는 flex 컨테이너(width:max-content) — 세션이 아무리
|
||||
@@ -4193,6 +4225,7 @@
|
||||
canvas.appendChild(boardAddStageBtn);
|
||||
}
|
||||
canvas.querySelectorAll(".pj-col").forEach(function (col) {
|
||||
wireBoardCollapse(col);
|
||||
const top = colScroll[colKey(col)];
|
||||
const b = col.querySelector(".pj-col-body");
|
||||
if (top && b) b.scrollTop = top;
|
||||
@@ -8375,6 +8408,51 @@
|
||||
});
|
||||
update();
|
||||
}
|
||||
// 공용 왼쪽 메뉴 너비: 170~500px, 마우스·방향키로 조절하고 브라우저에 기억.
|
||||
function initSideResize() {
|
||||
const layout = document.querySelector(".pj-layout");
|
||||
const side = layout && layout.querySelector(".pj-side");
|
||||
if (!side) return;
|
||||
const key = "pj_side_w";
|
||||
const handle = document.createElement("div");
|
||||
handle.className = "pj-side-resizer"; handle.tabIndex = 0;
|
||||
handle.setAttribute("role", "separator"); handle.setAttribute("aria-orientation", "vertical");
|
||||
handle.setAttribute("aria-label", "왼쪽 메뉴 너비 조절");
|
||||
handle.setAttribute("aria-valuemin", "170"); handle.setAttribute("aria-valuemax", "500");
|
||||
handle.title = "끌어서 메뉴 너비 조절 (최소 170px)";
|
||||
layout.appendChild(handle);
|
||||
function width() { return parseInt(layout.style.getPropertyValue("--pj-side-w"), 10) || Math.round(side.getBoundingClientRect().width / uiZoom()) || 250; }
|
||||
function apply(w) {
|
||||
w = Math.max(170, Math.min(500, Math.round(w)));
|
||||
layout.style.setProperty("--pj-side-w", w + "px"); handle.setAttribute("aria-valuenow", String(w));
|
||||
window.dispatchEvent(new Event("resize"));
|
||||
}
|
||||
function remember() { try { localStorage.setItem(key, String(width())); } catch (_) {} }
|
||||
try { const saved = Number(localStorage.getItem(key)); if (Number.isFinite(saved) && saved > 0) apply(saved); } catch (_) {}
|
||||
handle.setAttribute("aria-valuenow", String(width()));
|
||||
handle.addEventListener("mousedown", function (e) {
|
||||
if (e.button !== 0) return;
|
||||
e.preventDefault();
|
||||
const x = e.clientX, w = width();
|
||||
handle.classList.add("is-dragging"); document.documentElement.classList.add("pj-side-resizing");
|
||||
function move(ev) { apply(w + (ev.clientX - x) / uiZoom()); }
|
||||
function up() {
|
||||
document.removeEventListener("mousemove", move); document.removeEventListener("mouseup", up);
|
||||
handle.classList.remove("is-dragging"); document.documentElement.classList.remove("pj-side-resizing"); remember();
|
||||
}
|
||||
document.addEventListener("mousemove", move); document.addEventListener("mouseup", up);
|
||||
});
|
||||
handle.addEventListener("keydown", function (e) {
|
||||
if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(e.key)) return;
|
||||
e.preventDefault();
|
||||
apply(e.key === "Home" ? 170 : e.key === "End" ? 500 : width() + (e.key === "ArrowLeft" ? -10 : 10)); remember();
|
||||
});
|
||||
handle.addEventListener("dblclick", function () {
|
||||
layout.style.removeProperty("--pj-side-w");
|
||||
try { localStorage.removeItem(key); } catch (_) {}
|
||||
handle.setAttribute("aria-valuenow", String(width())); window.dispatchEvent(new Event("resize"));
|
||||
});
|
||||
}
|
||||
function initScrollIndicators() {
|
||||
document.querySelectorAll(".pj-side, .pj-mytasks-pane, .pj-inbox-pane")
|
||||
.forEach(attachScrollIndicator);
|
||||
@@ -8536,8 +8614,33 @@
|
||||
}
|
||||
applyColW();
|
||||
let lastColResize = 0;
|
||||
table.querySelectorAll(".pj-goal-colresize").forEach(function (h) {
|
||||
h.addEventListener("mousedown", function (e) {
|
||||
// rowspan/colspan 을 포함한 논리 열을 따라 각 셀의 오른쪽 경계에 손잡이를 붙인다.
|
||||
// 병합 셀에서는 오른쪽 끝 열의 너비를 조절한다. 새 줄·병합 뒤에도 다시 배선한다.
|
||||
function addColHandles() {
|
||||
const keys = Array.from(table.tHead.rows[0].cells).map(function (th) { return th.querySelector(".pj-goal-colresize").dataset.col; });
|
||||
const occupied = [];
|
||||
Array.from(table.rows).forEach(function (tr, r) {
|
||||
occupied[r] = occupied[r] || [];
|
||||
let c = 0;
|
||||
Array.from(tr.cells).forEach(function (td) {
|
||||
while (occupied[r][c]) c++;
|
||||
const end = c + td.colSpan - 1;
|
||||
for (let rr = r; rr < r + td.rowSpan; rr++) {
|
||||
occupied[rr] = occupied[rr] || [];
|
||||
for (let cc = c; cc <= end; cc++) occupied[rr][cc] = true;
|
||||
}
|
||||
if (!td.querySelector(".pj-goal-colresize") && keys[end]) {
|
||||
const h = document.createElement("span"); h.className = "pj-goal-colresize";
|
||||
h.dataset.col = keys[end]; h.title = "끌어서 너비 조절"; td.appendChild(h);
|
||||
}
|
||||
c = end + 1;
|
||||
});
|
||||
});
|
||||
}
|
||||
addColHandles();
|
||||
table.addEventListener("mousedown", function (e) {
|
||||
const h = e.target.closest(".pj-goal-colresize");
|
||||
if (!h) return;
|
||||
if (e.button !== 0) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@@ -8560,15 +8663,16 @@
|
||||
}
|
||||
document.addEventListener("mousemove", onMove);
|
||||
document.addEventListener("mouseup", onUp);
|
||||
});
|
||||
h.addEventListener("click", function (e) { e.stopPropagation(); });
|
||||
h.addEventListener("dblclick", function (e) {
|
||||
}, true);
|
||||
table.addEventListener("click", function (e) { if (e.target.closest(".pj-goal-colresize")) e.stopPropagation(); }, true);
|
||||
table.addEventListener("dblclick", function (e) {
|
||||
const h = e.target.closest(".pj-goal-colresize");
|
||||
if (!h) return;
|
||||
e.stopPropagation();
|
||||
colW[h.dataset.col] = colDefault[h.dataset.col];
|
||||
applyColW();
|
||||
saveColW();
|
||||
fitAll();
|
||||
});
|
||||
});
|
||||
|
||||
// ── 틀 고정 — 머리 줄 아래 숫자 지표(매출·로아스) 줄까지 세로 스크롤에도 위에 붙어 있다.
|
||||
@@ -8660,6 +8764,7 @@
|
||||
" · " + months.length + "개월";
|
||||
});
|
||||
});
|
||||
addColHandles(); // 합계·달성률의 textContent 를 바꾼 뒤에도 손잡이를 유지한다.
|
||||
}
|
||||
recompute();
|
||||
|
||||
@@ -8988,6 +9093,7 @@
|
||||
table.querySelectorAll("tbody.pj-goal-area").forEach(function (t) { t.remove(); });
|
||||
fresh.querySelectorAll("tbody.pj-goal-area").forEach(function (t) { table.appendChild(document.importNode(t, true)); });
|
||||
textSaver.prune();
|
||||
addColHandles();
|
||||
applyColW();
|
||||
QUARTERS.forEach(function (q) { applyFold(q, false); });
|
||||
bindTexts(table);
|
||||
@@ -10105,6 +10211,7 @@
|
||||
initMentionInbox();
|
||||
initLiveRefresh();
|
||||
initGlobalSearch();
|
||||
initSideResize();
|
||||
initScrollIndicators();
|
||||
initHoverTips();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user