fix(project): 목표 표 도구 막대가 오른쪽에 고정돼 누를 수 없던 버그 — 커서 오른쪽 위로
- 커서 오른쪽(같은 높이)에 두니 옆 칸으로 가로질러 갈 때 막대에 걸려 옆 칸 막대가 안 뜨고, 칸 오른쪽 끝에서 들어오면 막대가 칸 밖에 떠서 가는 중에 사라졌다 - 이제 커서 오른쪽 위: 가로 이동은 막대 밑으로 지나가고, 막대는 오른쪽 위로 가서 누름 - 커서가 멀어질 때(왼쪽·아래)만 따라오고 막대 쪽으로 갈 땐 그대로, 시작점은 이름 칸 안, 작은 호버 다리 - 캐시 버전 20261001p, 문서 갱신 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2093,6 +2093,8 @@ input.pj-goal-num:focus { outline: 2px solid var(--pj-accent); outline-offset: -
|
||||
}
|
||||
/* 커서 오른쪽에(initGoals placeTools 가 left/top 을 넣는다) — 가운데 맞춤 해제, 칸 밖으로 나가도 보이게 */
|
||||
.pj-goal-tools.is-at-cursor { transform: none; white-space: nowrap; }
|
||||
/* 커서 → 막대(오른쪽 위) 사이 보이지 않는 작은 다리 — 막대 왼쪽 아래 모서리만(옆 칸으로 가는 가로 길은 막지 않게 좁게) */
|
||||
.pj-goal-tools.is-at-cursor::before { content: ""; position: absolute; left: -10px; top: 100%; width: 22px; height: 8px; }
|
||||
.pj-goal-area-name:hover .pj-goal-tools, .pj-goal-row-label:hover .pj-goal-tools,
|
||||
.pj-goal-tools:focus-within { opacity: 1; pointer-events: auto; }
|
||||
.pj-goal-tools .pj-icon-btn { width: 30px; height: 30px; font-size: 20px; color: #8a4b14; border-radius: 7px; }
|
||||
|
||||
+17
-9
@@ -8547,23 +8547,31 @@
|
||||
});
|
||||
}
|
||||
|
||||
// ── 영역·줄 도구 막대(↑ ↓ + ×) — 마우스 커서 오른쪽에. 칸에 들어온 자리의 오른쪽(가로 고정)에 나타나 커서를 위아래로만
|
||||
// 따라간다(가로까지 따라가면 막대를 누르러 오른쪽으로 갈 때 막대가 계속 도망간다). 커서가 막대 위에 있으면 그대로.
|
||||
// 막대는 이름 칸 안에 있어 칸 → 막대로 옮겨도 사라지지 않는다. 화면 배율(uiZoom) 안이라 거리는 배율로 나눈다.
|
||||
// ── 영역·줄 도구 막대(색 ↑ ↓ + ×) — 마우스 커서 **오른쪽 위**에.
|
||||
// 커서 바로 오른쪽(같은 높이)에 두면 옆 칸으로 가로질러 갈 때 막대에 걸려 옆 칸 막대가 안 뜨고 막대가 "고정"돼 버린다
|
||||
// (2026-10-01 버그). 오른쪽 위에 두면 가로로는 막대 밑으로 지나가 옆 칸으로 넘어가고, 막대를 누를 땐 오른쪽 위로 간다.
|
||||
// 막대는 커서가 막대에서 멀어질 때(왼쪽·아래)만 따라오고, 막대 쪽(오른쪽·위)으로 갈 땐 그 자리에 있어 도망가지 않는다.
|
||||
// 커서가 막대보다 훨씬 위로 가면 다시 커서 높이로. 막대 시작점은 이름 칸 안(오른쪽 끝 − 10px 까지).
|
||||
// 막대는 이름 칸 안 요소라 막대 위에서도 칸 호버가 이어진다. 화면 배율(uiZoom) 안이라 거리는 배율로 나눈다.
|
||||
const TOOL_HOSTS = "th.pj-goal-area-name, th.pj-goal-row-label";
|
||||
let toolEntryX = 0;
|
||||
let toolAnchor = null; // {th, x, y} — 막대 기준점(커서 자리, 뷰포트 좌표)
|
||||
function placeTools(th, e) {
|
||||
const tools = th.querySelector(".pj-goal-tools");
|
||||
if (!tools || (e.target && e.target.closest && e.target.closest(".pj-goal-tools"))) return;
|
||||
const r = th.getBoundingClientRect(), z = uiZoom();
|
||||
const r = th.getBoundingClientRect(), z = uiZoom(), h = tools.offsetHeight * z;
|
||||
if (!toolAnchor || toolAnchor.th !== th) toolAnchor = { th: th, x: e.clientX, y: e.clientY };
|
||||
else {
|
||||
toolAnchor.x = Math.min(toolAnchor.x, e.clientX); // 왼쪽으로는 따라감
|
||||
if (e.clientY > toolAnchor.y || e.clientY < toolAnchor.y - h - 16) toolAnchor.y = e.clientY; // 아래로·훨씬 위로는 따라감
|
||||
}
|
||||
tools.classList.add("is-at-cursor");
|
||||
tools.style.left = Math.round((toolEntryX - r.left) / z + 14) + "px";
|
||||
tools.style.top = Math.round((e.clientY - r.top) / z - tools.offsetHeight / 2) + "px";
|
||||
tools.style.left = Math.round(Math.min((toolAnchor.x - r.left) / z + 8, r.width / z - 10)) + "px";
|
||||
tools.style.top = Math.round((toolAnchor.y - r.top) / z - tools.offsetHeight - 4) + "px";
|
||||
}
|
||||
table.addEventListener("mouseover", function (e) {
|
||||
const th = e.target.closest(TOOL_HOSTS);
|
||||
if (!th || (e.relatedTarget && th.contains(e.relatedTarget))) return; // 칸에 막 들어왔을 때만
|
||||
toolEntryX = e.clientX;
|
||||
if (!th || (e.relatedTarget && th.contains(e.relatedTarget))) return; // 칸에 막 들어왔을 때 — 기준점 새로
|
||||
toolAnchor = null;
|
||||
placeTools(th, e);
|
||||
});
|
||||
table.addEventListener("mousemove", function (e) {
|
||||
|
||||
Reference in New Issue
Block a user