Browse Source

Add inline onclick handler as fallback for admin close button

- Added console logging for debugging
- Increased timeout to 100ms to ensure DOM is ready
- Added preventDefault and stopPropagation
- Included inline onclick as fallback method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
master
HikeMap User 1 month ago
parent
commit
b4885c4a4f
  1. 12
      index.html

12
index.html

@ -5907,7 +5907,11 @@
setTimeout(() => {
const adminCloseBtn = document.getElementById('adminCloseBtn');
if (adminCloseBtn) {
adminCloseBtn.addEventListener('click', () => {
console.log('Admin close button found, attaching listener');
adminCloseBtn.addEventListener('click', (e) => {
console.log('Admin close button clicked');
e.preventDefault();
e.stopPropagation();
const adminOverlay = document.querySelector('.admin-panel-overlay');
if (adminOverlay) {
adminOverlay.classList.remove('active');
@ -5917,8 +5921,10 @@
// Switch back to edit tab
switchTab('edit');
});
} else {
console.error('Admin close button not found!');
}
}, 0);
}, 100);
// Password dialog
document.getElementById('passwordSubmit').addEventListener('click', checkPassword);
@ -6334,7 +6340,7 @@
<div class="admin-panel-overlay" id="adminOverlay">
<div class="admin-panel-header">
<h2>⚙️ Admin Settings</h2>
<button class="admin-panel-close" id="adminCloseBtn">×</button>
<button class="admin-panel-close" id="adminCloseBtn" onclick="document.querySelector('.admin-panel-overlay').classList.remove('active'); document.getElementById('adminTab').classList.remove('active'); switchTab('edit');">×</button>
</div>
<div class="admin-panel-content" id="adminContent">
<div class="section collapsible" data-section="geocache">

Loading…
Cancel
Save