feat(project): collapse meeting months by year
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
/* 목표 연도 아래 월 폴더와 주간 회의록 — 좁은 왼쪽 메뉴에서도 글자는 한 줄로 표시한다. */
|
||||
.pj-side-goal-branch { min-width: 0; }
|
||||
.pj-side-goal-year-row { display: flex; align-items: center; min-width: 0; }
|
||||
.pj-side-goal-year-row .pj-side-goal-year { flex: 1; min-width: 0; }
|
||||
/* 연도 이동 링크와 접기 버튼은 따로 눌러 사용할 수 있다. */
|
||||
.pj-side-goal-year-toggle { display: flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--pj-ink-soft); cursor: pointer; }
|
||||
.pj-side-goal-year-toggle:hover { background: #f1f2f4; }
|
||||
.pj-side-goal-year-toggle:focus-visible { outline: 2px solid var(--pj-accent); outline-offset: -2px; }
|
||||
.pj-side-goal-year-toggle .material-symbols-outlined { font-size: 18px; }
|
||||
.pj-side-goal-year-toggle[aria-expanded="true"] .material-symbols-outlined { transform: rotate(90deg); }
|
||||
.pj-side-meeting-months { padding-left: 8px; }
|
||||
.pj-side-meeting-months[hidden] { display: none; }
|
||||
.pj-side-meeting-month { min-width: 0; }
|
||||
.pj-side-meeting-month > summary {
|
||||
display: flex; align-items: center; gap: 5px; padding: 5px 4px;
|
||||
|
||||
@@ -6,6 +6,28 @@
|
||||
if (!branches.length) return;
|
||||
let loading = false, retry = null;
|
||||
const navigation = initMeetingNavigation();
|
||||
// 연도 접기는 월 폴더를 지우지 않고 숨겨서 각 월의 펼침 상태도 그대로 남긴다.
|
||||
branches.forEach(function (branch) {
|
||||
const button = branch.querySelector(".pj-side-goal-year-toggle");
|
||||
const list = branch.querySelector(".pj-side-meeting-months");
|
||||
if (!button || !list) return;
|
||||
const key = "pj_goal_year_open:" + branch.dataset.goalYear;
|
||||
function setOpen(open) {
|
||||
list.hidden = !open;
|
||||
button.setAttribute("aria-expanded", String(open));
|
||||
const action = open ? "하위 월 접기" : "하위 월 펼치기";
|
||||
button.setAttribute("aria-label", branch.dataset.goalYear + "년 " + action);
|
||||
button.title = action;
|
||||
}
|
||||
let saved = null;
|
||||
try { saved = localStorage.getItem(key); } catch (_) {}
|
||||
setOpen(saved !== "0");
|
||||
button.addEventListener("click", function () {
|
||||
const open = list.hidden;
|
||||
setOpen(open);
|
||||
try { localStorage.setItem(key, open ? "1" : "0"); } catch (_) {}
|
||||
});
|
||||
});
|
||||
|
||||
// 문자열을 HTML로 해석하지 않고 넣어 회의록 메뉴의 글자를 그대로 표시한다.
|
||||
function icon(name, cls) {
|
||||
|
||||
Reference in New Issue
Block a user