fix(project): 댓글 채팅 팝업 불러오기 실패 — avatarHtml 스코프 밖 참조
채팅 공용 코드(initCommentsChat)가 프로젝트 화면 init 안에만 있는 avatarHtml 을 불러 ReferenceError. 상위 스코프 chatAvatarHtml 로 교체. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260923g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260923h" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -96,5 +96,5 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/project.js?v=20260923g" defer></script>
|
||||
<script src="/static/project.js?v=20260923h" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260923g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260923h" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -117,5 +117,5 @@
|
||||
"today": {{ today | tojson }}
|
||||
}
|
||||
</script>
|
||||
<script src="/static/project.js?v=20260923g" defer></script>
|
||||
<script src="/static/project.js?v=20260923h" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260923g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260923h" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -518,5 +518,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260923g" defer></script>
|
||||
<script src="/static/project.js?v=20260923h" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
+20
-2
@@ -230,6 +230,23 @@
|
||||
"</label>";
|
||||
}
|
||||
|
||||
// 댓글 채팅 팝업의 상대방 아이콘 — 채팅은 프로젝트/내 업무 화면 공용 코드라
|
||||
// 화면별 init 안의 avatarHtml 을 못 본다. 페이지 #pj-data 의 avatars 맵을
|
||||
// 한 번만 읽어 쓴다(없으면 기본 아이콘).
|
||||
let pageAvatars = null;
|
||||
function chatAvatarHtml(email) {
|
||||
if (pageAvatars === null) {
|
||||
pageAvatars = {};
|
||||
try {
|
||||
const d = el("pj-data");
|
||||
if (d) pageAvatars = JSON.parse(d.textContent).avatars || {};
|
||||
} catch (_) {}
|
||||
}
|
||||
const url = email ? pageAvatars[String(email).toLowerCase()] : "";
|
||||
if (url) return '<img class="pj-avatar pj-chat-avatar" src="' + escapeHtml(url) + '" alt="" referrerpolicy="no-referrer">';
|
||||
return '<span class="material-symbols-outlined pj-gicon pj-chat-avatar">account_circle</span>';
|
||||
}
|
||||
|
||||
// ── 색상 팔레트 렌더 ───────────────────────────────────────
|
||||
// palette 를 생략하면 프로젝트 색(window.PJ_COLORS) — 세션 색상 선택은
|
||||
// window.PJ_STAGE_COLORS(아사나 10색)를 넘겨 같은 UI를 재사용한다.
|
||||
@@ -455,7 +472,7 @@
|
||||
// 상대방 댓글 — 카톡처럼 왼쪽에 프로필 아이콘, 그 옆에 이름 + 말풍선.
|
||||
li.innerHTML = mine
|
||||
? inner
|
||||
: '<span class="pj-chat-av">' + avatarHtml(c.author_email, "pj-chat-avatar") + "</span>" +
|
||||
: '<span class="pj-chat-av">' + chatAvatarHtml(c.author_email) + "</span>" +
|
||||
'<div class="pj-chat-body">' +
|
||||
'<span class="pj-chat-name">' + escapeHtml(idOf(c.author_email)) + "</span>" +
|
||||
inner +
|
||||
@@ -488,7 +505,8 @@
|
||||
}
|
||||
return comments.length;
|
||||
} catch (e) {
|
||||
list.innerHTML = "<li class='pj-empty-sm'>불러오기 실패</li>";
|
||||
console.error("댓글 불러오기 실패", e);
|
||||
list.innerHTML = "<li class='pj-empty-sm'>불러오기 실패: " + escapeHtml(e.message || "") + "</li>";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user