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" );
test( "destroy", function() {
expect( 1 );
expect( 2 );
domEqual( "#tabs1", function() {
$( "#tabs1" ).tabs().tabs( "destroy" );
});
domEqual( "#tabs2", function() {
$( "#tabs2" ).tabs().tabs( "destroy" );
});
});
test( "enable", function() {

View File

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