Handle stale localStorage when selecting the default tab in the UI #122

Merged
merged 1 commit into from Feb 20, 2013
Jump to file or symbol
Failed to load files and symbols.
+5 −0
Diff settings

Always

Just for now

@@ -247,6 +247,11 @@ pjax.updateTabState = function (src) {
} else {
tab = Y.one('#classdocs .api-class-tab.' + defaultTab);
+ // When the `defaultTab` node isn't found, `localStorage` is stale.
+ if (!tab && defaultTab !== 'index') {
+ tab = Y.one('#classdocs .api-class-tab.index');
+ }
+
if (classTabView.get('rendered')) {
Y.Widget.getByNode(tab).set('selected', 1);
} else {