N°3560 Fix object's tabs not opening tab specified in url's hash

This commit is contained in:
Stephen Abello
2021-02-17 17:33:01 +01:00
parent b7c7b05243
commit a6daa577e8
2 changed files with 8 additions and 4 deletions

View File

@@ -17,8 +17,8 @@ $.widget( "itop.scrollabletabs", $.ui.tabs, {
me._newScene(b.tab, b.panel).addTo(me.controller);
};
this.element.on('scrollabletabsload', afterloadajax);
this._super();
this._super(this.options);
// Load remote tabs as soon as possible
$(this.js_selectors.tab_toggler).each(function() {
@@ -37,7 +37,10 @@ $.widget( "itop.scrollabletabs", $.ui.tabs, {
me._newScene($(that).parent('li'), $($(that).attr('href'))).addTo(me.controller);
}
});
// Set active tab, tab-container gives us a tab based on url hash or 0
this.setTab(this._findActive(this.options.active));
this.controller.scrollTo('#' + this.tabs.eq(this.options.active).attr('data-tab-id'));
},
// Create a new scene to be added to the controller
_newScene: function(tab, panel)

View File

@@ -63,7 +63,8 @@ $(function()
let oTabsParams = {
classes: {
'ui-tabs-panel': 'ibo-tab-container--tab-container', // For ajax tabs, so their containers have the right CSS classes
}
},
active: $.bbq.getState( this.element.attr('id'), true ) || 0
};
if ($.bbq) {
// Enable tabs on all tab widgets. The `event` property must be overridden so