Browse files

Merge pull request #122 from ericf/default-tab-stale-localstorage

Handle stale localStorage when selecting the default tab in the UI
  • Loading branch information...
2 parents 76a9918 + 0dcb97a commit a2b131bec334df335ca6a021e9bf5ed08f533743 @davglass davglass committed Feb 20, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 themes/default/assets/js/apidocs.js
View
5 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 a2b131b

Please sign in to comment.