]> source.dussan.org Git - jquery-ui.git/commitdiff
Tabs: Remove ui-tabs-aria-controls data on destroy.
authorScott González <scott.gonzalez@gmail.com>
Fri, 16 Nov 2012 21:10:22 +0000 (16:10 -0500)
committerScott González <scott.gonzalez@gmail.com>
Fri, 16 Nov 2012 21:10:22 +0000 (16:10 -0500)
tests/unit/tabs/tabs_methods.js
ui/jquery.ui.tabs.js

index 076c3f379dab6ed4bb80af87db81f5ff6c7070d6..a3d663f272d53d1c9409aaf9a15defacc5744ff8 100644 (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() {
index 5b52271285e561c8eaf458e877615cc8ba46b44d..e557c6cecc77c812e306b60c24aade6777d8ae53 100644 (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" );
                        }