mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tabs: Better event binding/unbinding.
This commit is contained in:
parent
9608e98149
commit
6d9c77a268
7
ui/jquery.ui.tabs.js
vendored
7
ui/jquery.ui.tabs.js
vendored
@ -693,12 +693,11 @@ $.widget( "ui.tabs", {
|
|||||||
.removeClass( "ui-tabs-anchor" )
|
.removeClass( "ui-tabs-anchor" )
|
||||||
.removeAttr( "role" )
|
.removeAttr( "role" )
|
||||||
.removeAttr( "tabIndex" )
|
.removeAttr( "tabIndex" )
|
||||||
.unbind( ".tabs" )
|
|
||||||
.removeData( "href.tabs" )
|
.removeData( "href.tabs" )
|
||||||
.removeData( "load.tabs" )
|
.removeData( "load.tabs" )
|
||||||
.removeUniqueId();
|
.removeUniqueId();
|
||||||
|
|
||||||
this.tabs.unbind( ".tabs" ).add( this.panels ).each(function() {
|
this.tabs.add( this.panels ).each(function() {
|
||||||
if ( $.data( this, "ui-tabs-destroy" ) ) {
|
if ( $.data( this, "ui-tabs-destroy" ) ) {
|
||||||
$( this ).remove();
|
$( this ).remove();
|
||||||
} else {
|
} else {
|
||||||
@ -880,7 +879,7 @@ if ( $.uiBackCompat !== false ) {
|
|||||||
|
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
this.element.bind( "tabsbeforeload.tabs", function( event, ui ) {
|
this._on({ tabsbeforeload: function( event, ui ) {
|
||||||
// tab is already cached
|
// tab is already cached
|
||||||
if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) {
|
if ( $.data( ui.tab[ 0 ], "cache.tabs" ) ) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -905,7 +904,7 @@ if ( $.uiBackCompat !== false ) {
|
|||||||
$.data( ui.tab[ 0 ], "cache.tabs", true );
|
$.data( ui.tab[ 0 ], "cache.tabs", true );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}});
|
||||||
},
|
},
|
||||||
|
|
||||||
_setOption: function( key, value ) {
|
_setOption: function( key, value ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user