astro-tractstack 2.0.0-rc.13 → 2.0.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -400,60 +400,61 @@ const authStatus = {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
|
|
403
|
-
// Admin Modal JavaScript -
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
const closeBtn = document.getElementById('admin-modal-close');
|
|
407
|
-
const iframe = document.getElementById('admin-sysop-iframe');
|
|
408
|
-
|
|
409
|
-
if (heartBtn && modal && closeBtn && iframe) {
|
|
410
|
-
// Open modal when heart icon is clicked
|
|
411
|
-
heartBtn.addEventListener('click', function (e) {
|
|
403
|
+
// Admin Modal JavaScript - Use event delegation
|
|
404
|
+
document.addEventListener('click', function (e) {
|
|
405
|
+
if (e.target && (e.target as Element).closest('#admin-heart-btn')) {
|
|
412
406
|
e.preventDefault();
|
|
413
|
-
modal.
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
407
|
+
const modal = document.getElementById('admin-modal');
|
|
408
|
+
const closeBtn = document.getElementById('admin-modal-close');
|
|
409
|
+
|
|
410
|
+
if (modal && closeBtn) {
|
|
411
|
+
modal.classList.remove('hidden');
|
|
412
|
+
modal.setAttribute('aria-hidden', 'false');
|
|
413
|
+
closeBtn.focus();
|
|
414
|
+
document.body.style.overflow = 'hidden';
|
|
415
|
+
}
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
422
418
|
|
|
423
|
-
|
|
424
|
-
closeBtn.addEventListener('click', function (e) {
|
|
419
|
+
if (e.target && (e.target as Element).closest('#admin-modal-close')) {
|
|
425
420
|
e.preventDefault();
|
|
426
421
|
closeModal();
|
|
427
|
-
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
428
424
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
});
|
|
425
|
+
if (e.target && (e.target as Element).id === 'admin-modal') {
|
|
426
|
+
closeModal();
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
435
430
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
431
|
+
document.addEventListener('keydown', function (e) {
|
|
432
|
+
if (e.key === 'Escape') {
|
|
433
|
+
const modal = document.getElementById('admin-modal');
|
|
434
|
+
if (modal && !modal.classList.contains('hidden')) {
|
|
439
435
|
closeModal();
|
|
440
436
|
}
|
|
441
|
-
}
|
|
437
|
+
}
|
|
438
|
+
});
|
|
442
439
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
440
|
+
function closeModal() {
|
|
441
|
+
const modal = document.getElementById('admin-modal');
|
|
442
|
+
const heartBtn = document.getElementById('admin-heart-btn');
|
|
446
443
|
|
|
447
|
-
|
|
448
|
-
|
|
444
|
+
modal?.classList.add('hidden');
|
|
445
|
+
modal?.setAttribute('aria-hidden', 'true');
|
|
446
|
+
document.body.style.overflow = '';
|
|
447
|
+
heartBtn?.focus();
|
|
448
|
+
}
|
|
449
449
|
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
// iframe error handling
|
|
451
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
452
|
+
const iframe = document.getElementById('admin-sysop-iframe');
|
|
453
|
+
if (iframe) {
|
|
454
|
+
iframe.addEventListener('error', function () {
|
|
455
|
+
console.error('Failed to load admin panel');
|
|
456
|
+
});
|
|
452
457
|
}
|
|
453
|
-
|
|
454
|
-
iframe.addEventListener('error', function () {
|
|
455
|
-
console.error('Failed to load admin panel');
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
+
});
|
|
458
459
|
}
|
|
459
460
|
</script>
|