]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: prevent Reveal opening with its hash already set to add history entry
authorNicolas Coden <nicolas@ncoden.fr>
Mon, 26 Mar 2018 08:11:32 +0000 (10:11 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Mon, 26 Mar 2018 08:11:32 +0000 (10:11 +0200)
js/foundation.reveal.js

index 847d53f533df27dd0544f6058480edef1cd3521b..2029e970f392d59c713ed4431ba78959d481350c 100644 (file)
@@ -216,8 +216,8 @@ class Reveal extends Plugin {
    */
   open() {
     // either update or replace browser history
-    if (this.options.deepLink) {
-      var hash = `#${this.id}`;
+    const hash = `#${this.id}`;
+    if (this.options.deepLink && window.location.hash !== hash) {
 
       if (window.history.pushState) {
         if (this.options.updateHistory) {