Merge "Hygiene: remove window.location use from overlays"

This commit is contained in:
jenkins-bot 2018-03-08 17:59:56 +00:00 committed by Gerrit Code Review
commit 22ca1e5f39
1 changed files with 4 additions and 9 deletions

View File

@ -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 ) {