aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-11-16 16:10:22 -0500
committerScott González <scott.gonzalez@gmail.com>2012-11-16 16:10:22 -0500
commit23f7e30c77820904cc1813fc8b54b809b352a551 (patch)
tree5862aeb14e2e13c81a67dc873b9c68dfc8f37368
parent8f46418c35e597e81ba043f15b25258ab54483f0 (diff)
downloadjquery-ui-23f7e30c77820904cc1813fc8b54b809b352a551.tar.gz
jquery-ui-23f7e30c77820904cc1813fc8b54b809b352a551.zip
Tabs: Remove ui-tabs-aria-controls data on destroy.
-rw-r--r--tests/unit/tabs/tabs_methods.js5
-rw-r--r--ui/jquery.ui.tabs.js4
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js
index 076c3f379..a3d663f27 100644
--- a/tests/unit/tabs/tabs_methods.js
+++ b/tests/unit/tabs/tabs_methods.js
@@ -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() {
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 5b5227128..e557c6cec 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -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" );
}