Skip to content

Commit 6d9c77a

Browse files
committed
Tabs: Better event binding/unbinding.
1 parent 9608e98 commit 6d9c77a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ui/jquery.ui.tabs.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,12 +693,11 @@ $.widget( "ui.tabs", {
693693
.removeClass( "ui-tabs-anchor" )
694694
.removeAttr( "role" )
695695
.removeAttr( "tabIndex" )
696-
.unbind( ".tabs" )
697696
.removeData( "href.tabs" )
698697
.removeData( "load.tabs" )
699698
.removeUniqueId();
700699

701-
this.tabs.unbind( ".tabs" ).add( this.panels ).each(function() {
700+
this.tabs.add( this.panels ).each(function() {
702701
if ( $.data( this, "ui-tabs-destroy" ) ) {
703702
$( this ).remove();
704703
} else {
@@ -880,7 +879,7 @@ if ( $.uiBackCompat !== false ) {
880879

881880
var that = this;
882881

883-
this.element.bind( "tabsbeforeload.tabs", function( event, ui ) {
882+
this._on({ tabsbeforeload: function( event, ui ) {
884883
// tab is already cached
885884
if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) {
886885
event.preventDefault();
@@ -905,7 +904,7 @@ if ( $.uiBackCompat !== false ) {
905904
$.data( ui.tab[ 0 ], "cache.tabs", true );
906905
}
907906
});
908-
});
907+
}});
909908
},
910909

911910
_setOption: function( key, value ) {

0 commit comments

Comments
 (0)