]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fix a bug in tab changing
authorCyrille Chopelet <cyChop@users.noreply.github.com>
Sat, 1 Sep 2018 13:04:16 +0000 (15:04 +0200)
committerGitHub <noreply@github.com>
Sat, 1 Sep 2018 13:04:16 +0000 (15:04 +0200)
When using deepLink options, the handleTabChange will fail if using a non-standard markup (if there are DOM levels between the `.tabs-title` and the `a`).

This commit fixes precisely that.

js/foundation.tabs.js

index 1b191366c12af30b4acae3248a09d95ad09942a6..1afbcde58bd8dd6d585da14b3db174859b1a994b 100644 (file)
@@ -333,7 +333,7 @@ class Tabs extends Plugin {
       idStr = idStr.slice(1);
     }
 
-    var $target = this.$tabTitles.find(`[href$="${hashIdStr}"],[data-tabs-target="${idStr}"]`).first().parent(`.${this.options.linkClass}`);
+    var $target = this.$tabTitles.find(`[href$="${hashIdStr}"],[data-tabs-target="${idStr}"]`).first().parents(`.${this.options.linkClass}`);
 
     this._handleTabChange($target, historyHandled);
   };