feat(project): auto-fit all meeting columns on load
The weekly meeting table always starts with "fit all columns" instead of the widths saved in the browser; it refits once fonts load unless the user already resized a column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
});
|
||||
}
|
||||
handles(); applyWidths();
|
||||
let widthTouched = false; // 사람이 너비를 바꾸면 늦은 자동 맞춤(글꼴 로딩 뒤)이 덮지 않게
|
||||
const orderButton = document.getElementById("pj-meet-order");
|
||||
if (orderButton) new MutationObserver(handles).observe(table, { attributes: true, attributeFilter: ["class"] });
|
||||
function measure(td) {
|
||||
@@ -81,6 +82,7 @@
|
||||
finally { probe.remove(); }
|
||||
}
|
||||
function fit(key) {
|
||||
widthTouched = true;
|
||||
let width = minWidth(key);
|
||||
table.querySelectorAll("[data-meet-cols]").forEach(function (td) {
|
||||
const keys = td.dataset.meetCols.split(",");
|
||||
@@ -99,6 +101,12 @@
|
||||
});
|
||||
applyWidths(); saveWidths();
|
||||
}
|
||||
// 회의록을 열 때는 늘 전체 열 너비 자동 맞춤으로 시작한다(2026-10-07 요청 — 예전 저장 너비보다 우선).
|
||||
// 글꼴이 늦게 로드되면 글자 폭이 바뀌므로, 그 사이 사람이 너비를 바꾸지 않았으면 한 번 더 맞춘다.
|
||||
fitAll();
|
||||
if (document.fonts && document.fonts.status !== "loaded") {
|
||||
document.fonts.ready.then(function () { if (!widthTouched && table.isConnected) fitAll(); });
|
||||
}
|
||||
function widthItems(td) {
|
||||
const key = keyOf(td);
|
||||
return key ? [
|
||||
@@ -138,6 +146,7 @@
|
||||
if (!h || e.button !== 0) return;
|
||||
e.preventDefault(); e.stopPropagation();
|
||||
const key = h.dataset.col, x = e.clientX, before = widths[key];
|
||||
widthTouched = true;
|
||||
function move(ev) { widths[key] = Math.max(minWidth(key), Math.min(600, before + (ev.clientX - x) / opts.zoom())); applyWidths(); }
|
||||
function stop() { document.removeEventListener("mousemove", move); document.removeEventListener("mouseup", stop); window.removeEventListener("blur", stop); saveWidths(); }
|
||||
document.addEventListener("mousemove", move); document.addEventListener("mouseup", stop); window.addEventListener("blur", stop);
|
||||
|
||||
Reference in New Issue
Block a user