aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tabs.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-06-11 10:43:04 -0400
committerScott González <scott.gonzalez@gmail.com>2012-06-11 10:43:04 -0400
commit4866182deefdd06598b65fc79c6b8e7df05a54e4 (patch)
tree1dc8a1c9ce2376116c3fddd0f70541ab2a44aafa /ui/jquery.ui.tabs.js
parentaa1e8b5e6ce0b5012deb98dd30a93c89491dfa3f (diff)
downloadjquery-ui-4866182deefdd06598b65fc79c6b8e7df05a54e4.tar.gz
jquery-ui-4866182deefdd06598b65fc79c6b8e7df05a54e4.zip
Tabs: jQuery <1.7.2 treats .data() as a getter if the value to set is undefined.
Diffstat (limited to 'ui/jquery.ui.tabs.js')
-rw-r--r--ui/jquery.ui.tabs.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index a5d4730c5..5b9a6667b 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -384,7 +384,8 @@ $.widget( "ui.tabs", {
this.anchors.each(function( i, anchor ) {
var selector, panel, panelId,
anchorId = $( anchor ).uniqueId().attr( "id" ),
- tab = $( anchor ).closest( "li" );
+ tab = $( anchor ).closest( "li" ),
+ originalAriaControls = tab.attr( "aria-controls" );
// inline tab
if ( isLocal( anchor ) ) {
@@ -405,12 +406,13 @@ $.widget( "ui.tabs", {
if ( panel.length) {
that.panels = that.panels.add( panel );
}
- tab
- .data( "ui-tabs-aria-controls", tab.attr( "aria-controls" ) )
- .attr({
- "aria-controls": selector.substring( 1 ),
- "aria-labelledby": anchorId
- });
+ if ( originalAriaControls ) {
+ tab.data( "ui-tabs-aria-controls", originalAriaControls );
+ }
+ tab.attr({
+ "aria-controls": selector.substring( 1 ),
+ "aria-labelledby": anchorId
+ });
panel.attr( "aria-labelledby", anchorId );
});