Skip to content

Commit bb857dd

Browse files
committed
Tabs: Use ._focusable() and ._hoverable().
1 parent 17004b9 commit bb857dd

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

ui/jquery.ui.tabs.js

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -254,28 +254,8 @@ $.widget( "ui.tabs", {
254254
// remove all handlers before, tabify may run on existing tabs after add or option change
255255
this.lis.add( this.anchors ).unbind( ".tabs" );
256256

257-
if ( o.event !== "mouseover" ) {
258-
var addState = function( state, el ) {
259-
if ( el.is( ":not(.ui-state-disabled)" ) ) {
260-
el.addClass( "ui-state-" + state );
261-
}
262-
};
263-
var removeState = function( state, el ) {
264-
el.removeClass( "ui-state-" + state );
265-
};
266-
this.lis.bind( "mouseover.tabs" , function() {
267-
addState( "hover", $( this ) );
268-
});
269-
this.lis.bind( "mouseout.tabs", function() {
270-
removeState( "hover", $( this ) );
271-
});
272-
this.anchors.bind( "focus.tabs", function() {
273-
addState( "focus", $( this ).closest( "li" ) );
274-
});
275-
this.anchors.bind( "blur.tabs", function() {
276-
removeState( "focus", $( this ).closest( "li" ) );
277-
});
278-
}
257+
this._focusable( this.lis );
258+
this._hoverable( this.lis );
279259

280260
// set up animations
281261
var hideFx, showFx;
@@ -431,15 +411,12 @@ $.widget( "ui.tabs", {
431411
return index;
432412
},
433413

434-
destroy: function() {
414+
_destroy: function() {
435415
var o = this.options;
436416

437417
this.abort();
438418

439-
this.element
440-
.unbind( ".tabs" )
441-
.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" )
442-
.removeData( "tabs" );
419+
this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" );
443420

444421
this.list.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
445422

@@ -463,8 +440,6 @@ $.widget( "ui.tabs", {
463440
"ui-corner-top",
464441
"ui-tabs-selected",
465442
"ui-state-active",
466-
"ui-state-hover",
467-
"ui-state-focus",
468443
"ui-state-disabled",
469444
"ui-tabs-panel",
470445
"ui-widget-content",

0 commit comments

Comments
 (0)