From: Cyrille Chopelet Date: Sat, 1 Sep 2018 13:04:16 +0000 (+0200) Subject: Fix a bug in tab changing X-Git-Tag: v6.6.0~3^2~104^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da0bfda6d;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Fix a bug in tab changing 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. --- diff --git a/js/foundation.tabs.js b/js/foundation.tabs.js index 1b191366c..1afbcde58 100644 --- a/js/foundation.tabs.js +++ b/js/foundation.tabs.js @@ -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); };