Skip to content
Permalink
Browse files

Tabs: Use ._bind() for main event handling.

  • Loading branch information
scottgonzalez committed May 22, 2012
1 parent 9b37ed2 commit bbb44f9e67070d32d7961d675b04b5ff8134d2ae
Showing with 10 additions and 12 deletions.
  1. +10 −12 ui/jquery.ui.tabs.js
@@ -276,20 +276,18 @@ $.widget( "ui.tabs", {
},

_setupEvents: function( event ) {
// attach tab event handler, unbind to avoid duplicates from former tabifying...
this.anchors.unbind( ".tabs" );

// TODO: use event delegation via _bind()
var events = {
click: function( event ) {
event.preventDefault();
}
};
if ( event ) {
this.anchors.bind( event.split( " " ).join( ".tabs " ) + ".tabs",
$.proxy( this, "_eventHandler" ) );
$.each( event.split(" "), function( index, eventName ) {
events[ eventName ] = "_eventHandler";
});
}

// TODO: use event delegation via _bind()
// disable click in any case
this.anchors.bind( "click.tabs", function( event ){
event.preventDefault();
});
this.anchors.unbind( ".tabs" );
this._bind( this.anchors, events );
},

_eventHandler: function( event ) {

0 comments on commit bbb44f9

Please sign in to comment.
You can’t perform that action at this time.