fix: browser back button closes media overlay instead of navigating

This commit is contained in:
Johann
2026-06-09 19:30:15 +02:00
parent a8f78536f0
commit 61b3015896
+5
View File
@@ -1273,6 +1273,11 @@ if (isset($_GET['action'])) {
// Browser back/forward // Browser back/forward
window.addEventListener('popstate', (e) => { window.addEventListener('popstate', (e) => {
// If overlay is open, close it instead of navigating
if (overlay.classList.contains('active')) {
closeOverlay();
return;
}
if (e.state && e.state.path !== undefined) { if (e.state && e.state.path !== undefined) {
currentPath = e.state.path; currentPath = e.state.path;
historyStack = [e.state.path]; historyStack = [e.state.path];