aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-05-29 17:55:24 -0400
committerScott González <scott.gonzalez@gmail.com>2012-05-30 08:01:02 -0400
commitfe567eb9584892b3a035f74d5f75c149576fe1b8 (patch)
tree17b80aa502572b88fa4934b642a1a495cb32ffc4
parent240b22b1439df22408c5782e640e98cb335c7a2e (diff)
downloadjquery-ui-fe567eb9584892b3a035f74d5f75c149576fe1b8.tar.gz
jquery-ui-fe567eb9584892b3a035f74d5f75c149576fe1b8.zip
Tabs: Properly remove generated aria-controls attributes on destroy.
-rw-r--r--ui/jquery.ui.tabs.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index 79587bba6..a64dca6e4 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -247,7 +247,9 @@ $.widget( "ui.tabs", {
if ( panel.length) {
that.panels = that.panels.add( panel );
}
- tab.attr( "aria-controls", selector.substring( 1 ) );
+ tab
+ .data( "ui-tabs-aria-controls", tab.attr( "aria-controls" ) )
+ .attr( "aria-controls", selector.substring( 1 ) );
});
},
@@ -488,8 +490,17 @@ $.widget( "ui.tabs", {
"ui-tabs-panel",
"ui-widget-content",
"ui-corner-bottom"
- ].join( " " ) )
- .removeAttr( "aria-controls" );
+ ].join( " " ) );
+ }
+ });
+
+ this.lis.each(function() {
+ var li = $( this ),
+ prev = li.data( "ui-tabs-aria-controls" );
+ if ( prev ) {
+ li.attr( "aria-controls", prev );
+ } else {
+ li.removeAttr( "aria-controls" );
}
});