From: Martin Mares Date: Mon, 5 Nov 2018 20:23:29 +0000 (+0100) Subject: Highslide: Fix page jumps when closing thumbnails X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=a8bcc1dfefa2a6e139371f91ca93591543f3f058;p=gallery.git Highslide: Fix page jumps when closing thumbnails Fix by Jirka Setnička. --- diff --git a/highslide/custom.js b/highslide/custom.js index ae76993..7bc804b 100644 --- a/highslide/custom.js +++ b/highslide/custom.js @@ -55,7 +55,7 @@ hs.extend (hs.Expander.prototype, { }, onBeforeClose: function(sender) { - window.location.hash = ''; + window.location.hash = hashDelimiter; } }); @@ -63,7 +63,6 @@ function showDefaultImage() { var hashParts = window.location.hash.split(hashDelimiter); var myThumb = document.getElementById(hashParts[1]) if (hashParts[1] && myThumb) myThumb.click(); - else window.location.hash = ''; } // If the new hash is not equal to the hash we store internally, // then it must be the user hitting the "back/forward" button @@ -71,7 +70,7 @@ function checkHashChange() { var hashParts = window.location.hash.split(hashDelimiter); if (hashParts[1] != hashTag) { hs.close(); - window.location.hash = ''; + window.location.hash = hashDelimiter; } }