Skip to content
Permalink
Browse files

Tabs: Properly remove generated aria-controls attributes on destroy.

  • Loading branch information...
scottgonzalez committed May 29, 2012
1 parent 240b22b commit fe567eb9584892b3a035f74d5f75c149576fe1b8
Showing with 14 additions and 3 deletions.
  1. +14 −3 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" );
}
});

0 comments on commit fe567eb

Please sign in to comment.
You can’t perform that action at this time.