Skip to content

Commit a83fd54

Browse files
committed
Tabs: Add support for setOption with classes
1 parent e60077d commit a83fd54

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

ui/tabs.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,33 @@ return $.widget( "ui.tabs", {
275275
return index;
276276
},
277277

278+
_elementsFromClassKey: function( classKey ) {
279+
switch( classKey ) {
280+
case "ui-tabs":
281+
return this.element;
282+
case "ui-tabs-collapsible":
283+
if ( this.options.collapsible ) {
284+
return this.element;
285+
}
286+
case "ui-tabs-active":
287+
return this.active;
288+
case "ui-tabs-nav":
289+
return this.tablist;
290+
case "ui-tab":
291+
return this.tabs;
292+
case "ui-tabs-anchor":
293+
return this.anchors;
294+
case "ui-tabs-panel":
295+
return this.panels;
296+
case "ui-tabs-loading":
297+
if( this.tab.hasClass( classKey ) ) {
298+
return this.tab;
299+
}
300+
default:
301+
return this._superApply( arguments );
302+
}
303+
},
304+
278305
_setOption: function( key, value ) {
279306
if ( key === "active" ) {
280307
// _activate() will handle invalid values and update this.options

0 commit comments

Comments
 (0)