]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: use data-tabs-target to update history in Tabs deep-linking #11484 11485/head
authorNicolas Coden <nicolas@ncoden.fr>
Fri, 31 Aug 2018 21:40:57 +0000 (23:40 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Fri, 31 Aug 2018 21:40:57 +0000 (23:40 +0200)
Closes https://github.com/zurb/foundation-sites/issues/11484

js/foundation.tabs.js

index 1b191366c12af30b4acae3248a09d95ad09942a6..17ab129b06f7793e2d0127dc7e37178d8b5acf2f 100644 (file)
@@ -252,12 +252,10 @@ class Tabs extends Plugin {
 
     //either replace or update browser history
     if (this.options.deepLink && !historyHandled) {
-      var anchor = $target.find('a').attr('href');
-
       if (this.options.updateHistory) {
-        history.pushState({}, '', anchor);
+        history.pushState({}, '', hash);
       } else {
-        history.replaceState({}, '', anchor);
+        history.replaceState({}, '', hash);
       }
     }