aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tabs.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-05-22 15:12:38 -0400
committerScott González <scott.gonzalez@gmail.com>2012-05-22 15:12:38 -0400
commitbbb44f9e67070d32d7961d675b04b5ff8134d2ae (patch)
tree12333ab15988b0d46e380ba94f38ecd8b85cdbd7 /ui/jquery.ui.tabs.js
parent9b37ed24ce9ea8d3cf4d26a7728c8fd59c3d1a9c (diff)
downloadjquery-ui-bbb44f9e67070d32d7961d675b04b5ff8134d2ae.tar.gz
jquery-ui-bbb44f9e67070d32d7961d675b04b5ff8134d2ae.zip
Tabs: Use ._bind() for main event handling.
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r--ui/jquery.ui.tabs.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 34db46b9a..12b12ff5c 100644
--- a/ui/jquery.ui.tabs.js
+++ b/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 ) {