Tabs: Remove ui-tabs-aria-controls data on destroy.

This commit is contained in:
Scott González 2012-11-16 16:10:22 -05:00
parent 8f46418c35
commit 23f7e30c77
2 changed files with 7 additions and 2 deletions

View File

@ -6,10 +6,13 @@ var disabled = TestHelpers.tabs.disabled,
module( "tabs: methods" ); module( "tabs: methods" );
test( "destroy", function() { test( "destroy", function() {
expect( 1 ); expect( 2 );
domEqual( "#tabs1", function() { domEqual( "#tabs1", function() {
$( "#tabs1" ).tabs().tabs( "destroy" ); $( "#tabs1" ).tabs().tabs( "destroy" );
}); });
domEqual( "#tabs2", function() {
$( "#tabs2" ).tabs().tabs( "destroy" );
});
}); });
test( "enable", function() { test( "enable", function() {

View File

@ -710,7 +710,9 @@ $.widget( "ui.tabs", {
var li = $( this ), var li = $( this ),
prev = li.data( "ui-tabs-aria-controls" ); prev = li.data( "ui-tabs-aria-controls" );
if ( prev ) { if ( prev ) {
li.attr( "aria-controls", prev ); li
.attr( "aria-controls", prev )
.removeData( "ui-tabs-aria-controls" );
} else { } else {
li.removeAttr( "aria-controls" ); li.removeAttr( "aria-controls" );
} }