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

This commit is contained in:
Scott González 2012-05-29 17:55:24 -04:00
parent 240b22b143
commit fe567eb958

17
ui/jquery.ui.tabs.js vendored
View File

@ -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" );
}
});