]> mj.ucw.cz Git - gallery.git/commitdiff
Highslide: Fix page jumps when closing thumbnails
authorMartin Mares <mj@ucw.cz>
Mon, 5 Nov 2018 20:23:29 +0000 (21:23 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 5 Nov 2018 20:23:29 +0000 (21:23 +0100)
Fix by Jirka Setnička.

highslide/custom.js

index ae7699312f3bf7b613d1412ca6e135cc269853ed..7bc804b17528eb9afb226e4660e948ded97c6f12 100644 (file)
@@ -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;
        }
 }