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 ) {
|
_setupEvents: function( event ) {
|
||||||
// attach tab event handler, unbind to avoid duplicates from former tabifying...
|
var events = {
|
||||||
this.anchors.unbind( ".tabs" );
|
click: function( event ) {
|
||||||
|
event.preventDefault();
|
||||||
// TODO: use event delegation via _bind()
|
}
|
||||||
|
};
|
||||||
if ( event ) {
|
if ( event ) {
|
||||||
this.anchors.bind( event.split( " " ).join( ".tabs " ) + ".tabs",
|
$.each( event.split(" "), function( index, eventName ) {
|
||||||
$.proxy( this, "_eventHandler" ) );
|
events[ eventName ] = "_eventHandler";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
this.anchors.unbind( ".tabs" );
|
||||||
// TODO: use event delegation via _bind()
|
this._bind( this.anchors, events );
|
||||||
// disable click in any case
|
|
||||||
this.anchors.bind( "click.tabs", function( event ){
|
|
||||||
event.preventDefault();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_eventHandler: function( event ) {
|
_eventHandler: function( event ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user