]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Use pull request #11485 from ncoden/fix/tabs-deep-link-custom-target-11484 for v6.5.0
authorNicolas Coden <nicolas@ncoden.fr>
Mon, 10 Sep 2018 20:57:38 +0000 (22:57 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Mon, 10 Sep 2018 20:57:38 +0000 (22:57 +0200)
f974a5b1f fix: use data-tabs-target to update history in Tabs deep-linking #11484

Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
js/foundation.tabs.js

index c0d8eb0a4859e1650d2e5e1f3d91c3028fd3d112..b59a10cda296fa364e8f79e7fb30029ec4e3fe58 100644 (file)
@@ -253,12 +253,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);
       }
     }