From: Vic McGlaughlin Date: Tue, 2 Feb 2016 16:33:29 +0000 (-0500) Subject: only search for the target tab content within the existing tab content element, resol... X-Git-Tag: v6.2.0-rc.1~35^2~4^2~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8055%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git only search for the target tab content within the existing tab content element, resolves issue unit testing Tabs where target tab may not exist in global jQuery context --- diff --git a/js/foundation.tabs.js b/js/foundation.tabs.js index 3a1a06fcf..5bc89dbbf 100644 --- a/js/foundation.tabs.js +++ b/js/foundation.tabs.js @@ -210,7 +210,7 @@ Tabs.prototype._handleTabChange = function($target){ var $tabLink = $target.find('[role="tab"]'), hash = $tabLink[0].hash, - $targetContent = $(hash), + $targetContent = this.$tabContent.find(hash), $oldTab = this.$element.find('.' + this.options.linkClass + '.is-active') .removeClass('is-active').find('[role="tab"]') .attr({'aria-selected': 'false'}).attr('aria-controls');