File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -276,20 +276,18 @@ $.widget( "ui.tabs", {
276
276
} ,
277
277
278
278
_setupEvents : function ( event ) {
279
- // attach tab event handler, unbind to avoid duplicates from former tabifying...
280
- this . anchors . unbind ( ".tabs" ) ;
281
-
282
- // TODO: use event delegation via _bind()
279
+ var events = {
280
+ click : function ( event ) {
281
+ event . preventDefault ( ) ;
282
+ }
283
+ } ;
283
284
if ( event ) {
284
- this . anchors . bind ( event . split ( " " ) . join ( ".tabs " ) + ".tabs" ,
285
- $ . proxy ( this , "_eventHandler" ) ) ;
285
+ $ . each ( event . split ( " " ) , function ( index , eventName ) {
286
+ events [ eventName ] = "_eventHandler" ;
287
+ } ) ;
286
288
}
287
-
288
- // TODO: use event delegation via _bind()
289
- // disable click in any case
290
- this . anchors . bind ( "click.tabs" , function ( event ) {
291
- event . preventDefault ( ) ;
292
- } ) ;
289
+ this . anchors . unbind ( ".tabs" ) ;
290
+ this . _bind ( this . anchors , events ) ;
293
291
} ,
294
292
295
293
_eventHandler : function ( event ) {
You can’t perform that action at this time.
0 commit comments