From a8bcc1dfefa2a6e139371f91ca93591543f3f058 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 5 Nov 2018 21:23:29 +0100 Subject: [PATCH] Highslide: Fix page jumps when closing thumbnails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix by Jirka Setnička. --- highslide/custom.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; } } -- 2.39.2