Updating TabSet.js to open tabs correctly on page load when hash is added to URL

This commit is contained in:
Tim Kung 2016-08-24 09:05:02 +12:00
parent 6d4625f067
commit 0461d1c019

View File

@ -38,7 +38,7 @@
var $trigger;
// Make sure the hash relates to a valid tab.
$.each(this.find('.cms-panel-link'), function () {
$.each(this.find('.ui-tabs-anchor'), function() {
// The hash in in the button's href and there is exactly one tab with that id.
if (this.href.indexOf(hash) !== -1 && $(hash).length === 1) {
$trigger = $(this);
@ -52,7 +52,7 @@
}
// Switch to the correct tab when AJAX loading completes.
$(window).one('ajaxComplete', function () {
$(document).ready(function() {
$trigger.click();
});
},