fix:daily-logs toggleAttentionItem 이벤트 위임 방식으로 변경

This commit is contained in:
pro
2026-01-21 20:20:10 +09:00
parent cd74809f2e
commit 0be0f41bd9

View File

@@ -198,7 +198,7 @@ class="day-card w-full text-left p-3 rounded-lg border-2 transition-all hover:sh
</span>
<!-- 제목 -->
<span class="attention-item-text flex-1 text-sm text-gray-700 truncate cursor-pointer hover:text-red-600"
onclick="toggleAttentionItem(this)"
data-toggle-attention
title="{{ $issue->title }}">{{ $issue->title }}</span>
<!-- 상태변경 버튼 -->
<div class="flex gap-0.5 opacity-30 group-hover:opacity-100 transition-opacity shrink-0">
@@ -300,7 +300,7 @@ class="p-0.5 text-green-500 hover:bg-green-50 rounded" title="해결">
</span>
<!-- 제목 -->
<span class="attention-item-text flex-1 text-sm text-gray-700 truncate cursor-pointer hover:text-orange-600"
onclick="toggleAttentionItem(this)"
data-toggle-attention
title="{{ $task->title }}">{{ $task->title }}</span>
<!-- 상태변경 버튼 -->
<div class="flex gap-0.5 opacity-30 group-hover:opacity-100 transition-opacity shrink-0">
@@ -1209,11 +1209,17 @@ function confirmForceDelete(id, date) {
}
// ========================================
// 주의 필요 항목 펼치기/접기
// 주의 필요 항목 펼치기/접기 (이벤트 위임)
// ========================================
function toggleAttentionItem(textEl) {
document.addEventListener('click', function(e) {
const textEl = e.target.closest('[data-toggle-attention]');
if (!textEl) return;
const itemDiv = textEl.closest('[data-issue-id], [data-task-id]');
if (!itemDiv) return;
const fullDiv = itemDiv.querySelector('.attention-item-full');
if (!fullDiv) return;
if (fullDiv.classList.contains('hidden')) {
// 펼치기: 상세 정보 표시 + 제목 전체 표시
@@ -1226,7 +1232,7 @@ function toggleAttentionItem(textEl) {
textEl.classList.add('truncate');
textEl.classList.remove('text-red-600');
}
}
});
// ========================================
// 미완료 항목 펼치기/접기