UI 개선 — 모바일 사이드바 하단에 로그아웃 버튼 추가
모바일에서 nav-user가 숨겨져 로그아웃 불가한 문제 수정. renderNav에서 사이드바 하단에 사용자명·역할 표시와 로그아웃 링크를 자동 주입. 모든 역할(관리자·정비사·제조사·옵저버) 공통 적용. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -48,11 +48,21 @@ const Auth = (() => {
|
||||
document.body.appendChild(ov);
|
||||
}
|
||||
|
||||
// 사이드바 링크 클릭 시 드로어 닫기
|
||||
// 사이드바 링크 클릭 시 드로어 닫기 + 하단 로그아웃 주입 (모바일용)
|
||||
setTimeout(() => {
|
||||
document.querySelectorAll('.sidebar a').forEach(a => {
|
||||
a.addEventListener('click', closeMobileNav);
|
||||
});
|
||||
const sidebar = document.querySelector('.sidebar');
|
||||
if (sidebar && !sidebar.querySelector('.sidebar-user-footer')) {
|
||||
const footer = document.createElement('div');
|
||||
footer.className = 'sidebar-user-footer';
|
||||
footer.innerHTML = `
|
||||
<div style="border-top:1px solid rgba(255,255,255,.12);margin:12px 0 4px;"></div>
|
||||
<div style="padding:6px 20px;font-size:11px;color:rgba(255,255,255,.4);">${name()} <span style="color:var(--accent)">[${role()}]</span></div>
|
||||
<a onclick="Auth.logout()" style="cursor:pointer;color:rgba(255,255,255,.6);">🚪 로그아웃</a>`;
|
||||
sidebar.appendChild(footer);
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user