From 8119859189d01a0268adc0c691c5fb367b03eb0d Mon Sep 17 00:00:00 2001 From: king Date: Mon, 28 Sep 2026 21:19:43 +0900 Subject: [PATCH] =?UTF-8?q?fix(project):=20=EB=8C=93=EA=B8=80=EC=B9=B8=20?= =?UTF-8?q?=EB=A9=A4=EB=B2=84=20=ED=83=9C=EA=B7=B8=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=EC=9D=84=20@=20=EC=95=84=EC=9D=B4=EC=BD=98=20=EC=9C=97?= =?UTF-8?q?=EB=B6=80=EB=B6=84=EC=97=90=20=EB=9D=84=EC=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ 버튼이 있는 입력칸은 멤버 목록을 그 버튼 위쪽(오른쪽 끝 맞춤)에 띄우고, 위 공간이 없을 때만 아래로. 설명란 태그 목록은 기존대로 커서 아래. Co-Authored-By: Claude Opus 5.5 --- .../project/templates/project/help.html | 2 +- .../project/templates/project/inbox.html | 4 ++-- .../project/templates/project/mytasks.html | 4 ++-- .../project/templates/project/project.html | 4 ++-- .../project/templates/project/trash.html | 4 ++-- app/static/project.js | 22 +++++++++++++------ 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index 7a0548d..ad9124f 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index d319ae2..62aa012 100644 --- a/app/modules/project/templates/project/inbox.html +++ b/app/modules/project/templates/project/inbox.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -104,5 +104,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html index 071d5ca..fa8b751 100644 --- a/app/modules/project/templates/project/mytasks.html +++ b/app/modules/project/templates/project/mytasks.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -100,5 +100,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 31edfb1..1f16c2a 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + @@ -491,5 +491,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index 171e8e7..0c94b37 100644 --- a/app/modules/project/templates/project/trash.html +++ b/app/modules/project/templates/project/trash.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -70,5 +70,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/static/project.js b/app/static/project.js index 67bbb9a..117c225 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -1613,7 +1613,8 @@ window.addEventListener("resize", closeMentionMenu); return mentionMenuEl; } - function renderMentionMenu(users, rect, onPick) { + // opts.above — 기준(rect) 위쪽에 우선 띄우고 오른쪽 끝을 기준에 맞춘다(댓글칸 @ 버튼). + function renderMentionMenu(users, rect, onPick, opts) { const menu = ensureMentionMenu(); menu.innerHTML = ""; if (!users.length) { @@ -1633,12 +1634,16 @@ }); } menu.hidden = false; - // 커서/입력칸 바로 아래. 화면 밖으로 나가면 위쪽으로 뒤집는다. + // 기본: 커서/입력칸 바로 아래, 화면 밖으로 나가면 위쪽으로 뒤집는다. + // opts.above: 기준 위쪽(아이콘 윗부분), 위 공간이 없으면 아래로. + const above = !!(opts && opts.above); let top = window.scrollY + rect.bottom + 4; - let left = window.scrollX + rect.left; + let left = window.scrollX + (above ? rect.right - menu.offsetWidth : rect.left); left = Math.min(left, window.scrollX + document.documentElement.clientWidth - menu.offsetWidth - 8); - if (rect.bottom + menu.offsetHeight + 8 > document.documentElement.clientHeight) { - top = window.scrollY + rect.top - menu.offsetHeight - 4; + if (above + ? rect.top - menu.offsetHeight - 6 >= 8 + : rect.bottom + menu.offsetHeight + 8 > document.documentElement.clientHeight) { + top = window.scrollY + rect.top - menu.offsetHeight - (above ? 6 : 4); } menu.style.left = Math.max(8, left) + "px"; menu.style.top = Math.max(8, top) + "px"; @@ -1705,7 +1710,10 @@ const ctx = caretQuery(); if (!ctx) { closeMentionMenu(); return; } const users = filterMentionUsers(await mentionUsers(), ctx.query); - renderMentionMenu(users, input.getBoundingClientRect(), function (u) { + // 옆에 @ 버튼이 있는 댓글칸이면 멤버 목록은 그 아이콘 윗부분에 띄운다. + const atBtn = input.parentNode && input.parentNode.querySelector(".pj-mention-btn"); + const anchorRect = atBtn ? atBtn.getBoundingClientRect() : input.getBoundingClientRect(); + renderMentionMenu(users, anchorRect, function (u) { const token = "@" + capName(u.id || u.email.split("@")[0]); input.value = input.value.slice(0, ctx.start) + token + " " + input.value.slice(ctx.end); input._pjMentions[token] = u.email; @@ -1713,7 +1721,7 @@ input.focus(); input.setSelectionRange(caret, caret); closeMentionMenu(); - }); + }, { above: !!atBtn }); } input.addEventListener("input", maybeOpen); input.addEventListener("blur", function () { setTimeout(closeMentionMenu, 120); });