mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tabs: Use ._bind() for main event handling.
This commit is contained in:
parent
9b37ed24ce
commit
bbb44f9e67
22
ui/jquery.ui.tabs.js
vendored
22
ui/jquery.ui.tabs.js
vendored
@ -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()
|
||||
if ( event ) {
|
||||
this.anchors.bind( event.split( " " ).join( ".tabs " ) + ".tabs",
|
||||
$.proxy( this, "_eventHandler" ) );
|
||||
}
|
||||
|
||||
// TODO: use event delegation via _bind()
|
||||
// disable click in any case
|
||||
this.anchors.bind( "click.tabs", function( event ){
|
||||
var events = {
|
||||
click: function( event ) {
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
if ( event ) {
|
||||
$.each( event.split(" "), function( index, eventName ) {
|
||||
events[ eventName ] = "_eventHandler";
|
||||
});
|
||||
}
|
||||
this.anchors.unbind( ".tabs" );
|
||||
this._bind( this.anchors, events );
|
||||
},
|
||||
|
||||
_eventHandler: function( event ) {
|
||||
|
Loading…
Reference in New Issue
Block a user