Hygiene: remove window.location use from overlays

Bug: T173539
Depends-On: I158dd7883be2846cf0d48bbd7e89fe2cd64a57d3
Change-Id: I87741667ca06cc701e5265aff13ba0492501de26
This commit is contained in:
Stephen Niedzielski 2018-03-06 21:30:56 -06:00
parent ce2b87e1c6
commit 41a43c5ce1

View file

@ -112,15 +112,10 @@
thumbnails: thumbs, thumbnails: thumbs,
title: decodeURIComponent( title ) title: decodeURIComponent( title )
} ); } );
imageOverlay.on( ImageOverlay.EVENT_EXIT, function ( ev ) { imageOverlay.on( ImageOverlay.EVENT_EXIT, function () {
// Prevent going back in browser's history. // Actually dismiss the overlay whenever the cross is closed.
// See T94188 & T94363. window.location.hash = '';
ev.preventDefault(); // Clear the hash.
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.
router.navigate( '' ); router.navigate( '' );
} ); } );
imageOverlay.on( ImageOverlay.EVENT_SLIDE, function ( nextThumbnail ) { imageOverlay.on( ImageOverlay.EVENT_SLIDE, function ( nextThumbnail ) {