From 41a43c5ce19d41580679ee7ab5d16f5c7f6d4d5c Mon Sep 17 00:00:00 2001 From: Stephen Niedzielski Date: Tue, 6 Mar 2018 21:30:56 -0600 Subject: [PATCH] Hygiene: remove window.location use from overlays Bug: T173539 Depends-On: I158dd7883be2846cf0d48bbd7e89fe2cd64a57d3 Change-Id: I87741667ca06cc701e5265aff13ba0492501de26 --- resources/skins.minerva.scripts/init.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/resources/skins.minerva.scripts/init.js b/resources/skins.minerva.scripts/init.js index f9daef6e9..42249dbe3 100644 --- a/resources/skins.minerva.scripts/init.js +++ b/resources/skins.minerva.scripts/init.js @@ -112,15 +112,10 @@ thumbnails: thumbs, title: decodeURIComponent( title ) } ); - imageOverlay.on( ImageOverlay.EVENT_EXIT, function ( ev ) { - // Prevent going back in browser's history. - // See T94188 & T94363. - ev.preventDefault(); - ev.stopPropagation(); - // Manually close the overlay (OverlayManager does not expose a method - // to hide the active overlay). - imageOverlay.hide(); - // Update the URL by clearing fragment. + imageOverlay.on( ImageOverlay.EVENT_EXIT, function () { + // Actually dismiss the overlay whenever the cross is closed. + window.location.hash = ''; + // Clear the hash. router.navigate( '' ); } ); imageOverlay.on( ImageOverlay.EVENT_SLIDE, function ( nextThumbnail ) {