Navigation Menu

Skip to content

Commit

Permalink
Tabs: jQuery <1.7.2 treats .data() as a getter if the value to set is…
Browse files Browse the repository at this point in the history
… undefined.
  • Loading branch information
scottgonzalez committed Jun 11, 2012
1 parent aa1e8b5 commit 4866182
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ui/jquery.ui.tabs.js
Expand Up @@ -384,7 +384,8 @@ $.widget( "ui.tabs", {
this.anchors.each(function( i, anchor ) { this.anchors.each(function( i, anchor ) {
var selector, panel, panelId, var selector, panel, panelId,
anchorId = $( anchor ).uniqueId().attr( "id" ), anchorId = $( anchor ).uniqueId().attr( "id" ),
tab = $( anchor ).closest( "li" ); tab = $( anchor ).closest( "li" ),
originalAriaControls = tab.attr( "aria-controls" );


// inline tab // inline tab
if ( isLocal( anchor ) ) { if ( isLocal( anchor ) ) {
Expand All @@ -405,12 +406,13 @@ $.widget( "ui.tabs", {
if ( panel.length) { if ( panel.length) {
that.panels = that.panels.add( panel ); that.panels = that.panels.add( panel );
} }
tab if ( originalAriaControls ) {
.data( "ui-tabs-aria-controls", tab.attr( "aria-controls" ) ) tab.data( "ui-tabs-aria-controls", originalAriaControls );
.attr({ }
"aria-controls": selector.substring( 1 ), tab.attr({
"aria-labelledby": anchorId "aria-controls": selector.substring( 1 ),
}); "aria-labelledby": anchorId
});
panel.attr( "aria-labelledby", anchorId ); panel.attr( "aria-labelledby", anchorId );
}); });


Expand Down

0 comments on commit 4866182

Please sign in to comment.