]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Better event binding/unbinding.
authorScott González <scott.gonzalez@gmail.com>
Wed, 13 Jun 2012 14:40:41 +0000 (10:40 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 13 Jun 2012 14:40:41 +0000 (10:40 -0400)
ui/jquery.ui.tabs.js

index 5878a56a17c10053d736ec33692d202440e95cec..21736641f24983a0caa0759f6838c6754e488d4e 100644 (file)
@@ -693,12 +693,11 @@ $.widget( "ui.tabs", {
                        .removeClass( "ui-tabs-anchor" )
                        .removeAttr( "role" )
                        .removeAttr( "tabIndex" )
-                       .unbind( ".tabs" )
                        .removeData( "href.tabs" )
                        .removeData( "load.tabs" )
                        .removeUniqueId();
 
-               this.tabs.unbind( ".tabs" ).add( this.panels ).each(function() {
+               this.tabs.add( this.panels ).each(function() {
                        if ( $.data( this, "ui-tabs-destroy" ) ) {
                                $( this ).remove();
                        } else {
@@ -880,7 +879,7 @@ if ( $.uiBackCompat !== false ) {
 
                        var that = this;
 
-                       this.element.bind( "tabsbeforeload.tabs", function( event, ui ) {
+                       this._on({ tabsbeforeload: function( event, ui ) {
                                // tab is already cached
                                if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) {
                                        event.preventDefault();
@@ -905,7 +904,7 @@ if ( $.uiBackCompat !== false ) {
                                                $.data( ui.tab[ 0 ], "cache.tabs", true );
                                        }
                                });
-                       });
+                       }});
                },
 
                _setOption: function( key, value ) {