From bb857ddd8d6d4ac7620b49bf765352cd064494c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Mon, 31 Jan 2011 21:56:55 -0500 Subject: [PATCH] Tabs: Use ._focusable() and ._hoverable(). --- ui/jquery.ui.tabs.js | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 8ab3bdf40..21ad6ddec 100755 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -254,28 +254,8 @@ $.widget( "ui.tabs", { // remove all handlers before, tabify may run on existing tabs after add or option change this.lis.add( this.anchors ).unbind( ".tabs" ); - if ( o.event !== "mouseover" ) { - var addState = function( state, el ) { - if ( el.is( ":not(.ui-state-disabled)" ) ) { - el.addClass( "ui-state-" + state ); - } - }; - var removeState = function( state, el ) { - el.removeClass( "ui-state-" + state ); - }; - this.lis.bind( "mouseover.tabs" , function() { - addState( "hover", $( this ) ); - }); - this.lis.bind( "mouseout.tabs", function() { - removeState( "hover", $( this ) ); - }); - this.anchors.bind( "focus.tabs", function() { - addState( "focus", $( this ).closest( "li" ) ); - }); - this.anchors.bind( "blur.tabs", function() { - removeState( "focus", $( this ).closest( "li" ) ); - }); - } + this._focusable( this.lis ); + this._hoverable( this.lis ); // set up animations var hideFx, showFx; @@ -431,15 +411,12 @@ $.widget( "ui.tabs", { return index; }, - destroy: function() { + _destroy: function() { var o = this.options; this.abort(); - this.element - .unbind( ".tabs" ) - .removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ) - .removeData( "tabs" ); + this.element.removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" ); this.list.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" ); @@ -463,8 +440,6 @@ $.widget( "ui.tabs", { "ui-corner-top", "ui-tabs-selected", "ui-state-active", - "ui-state-hover", - "ui-state-focus", "ui-state-disabled", "ui-tabs-panel", "ui-widget-content", -- 2.39.5