fix: browser back button closes media overlay instead of navigating
This commit is contained in:
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user