Permalink
Browse files

Handle stale localStorage when selecting the default tab in the UI

Fixes #121
  • Loading branch information...
1 parent 76a9918 commit 0dcb97aa2f9a2d13356c382cccaa37d3f90b90fa @ericf committed Feb 20, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 themes/default/assets/js/apidocs.js
@@ -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 {

0 comments on commit 0dcb97a

Please sign in to comment.