From 23f7e30c77820904cc1813fc8b54b809b352a551 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 16 Nov 2012 16:10:22 -0500 Subject: [PATCH] Tabs: Remove ui-tabs-aria-controls data on destroy. --- tests/unit/tabs/tabs_methods.js | 5 ++++- ui/jquery.ui.tabs.js | 4 +++- 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" ); } -- 2.39.5