]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Merge branch 'develop' into bugfix/10836-magellan-clear-hash
authorNicolas Venegas <nvenegas@atlassian.com>
Wed, 3 Jan 2018 22:05:51 +0000 (09:05 +1100)
committerGitHub <noreply@github.com>
Wed, 3 Jan 2018 22:05:51 +0000 (09:05 +1100)
1  2 
js/foundation.magellan.js

index b31b3dd08a8b260cdd2589118431c87909161e59,9c1f307e2c414e198defd49479b070187418c8df..42e7eaa170e5bd4525711c0a68ad2cf099ac055c
@@@ -177,10 -173,13 +177,14 @@@ class Magellan extends Plugin 
          hash = this.$active[0].getAttribute('href');
        }
        if(hash !== window.location.hash) {
 -        if (window.history.pushState) {
 -          if (this.options.updateHistory) {
 -            window.history.pushState({}, '', hash);
 -          } else {
 -            window.history.replaceState({}, '', hash);
 +        if(window.history.pushState){
 +          var url = curIdx !== undefined ? hash : window.location.pathname;
-           window.history.pushState(null, null, url);
++          if(this.options.updateHistory){
++            window.history.pushState({}, '', url);
++          }else{
++            window.history.replaceState({}, '', url);
+           }
 -        } else {
 +        }else{
            window.location.hash = hash;
          }
        }