'require validation';
'require baseclass';
'require request';
+'require session';
'require poll';
'require dom';
'require rpc';
/** @private */
getActiveTabState: function() {
- var page = document.body.getAttribute('data-page');
+ var page = document.body.getAttribute('data-page'),
+ state = session.getLocalData('tab');
- try {
- var val = JSON.parse(window.sessionStorage.getItem('tab'));
- if (val.page === page && L.isObject(val.paths))
- return val;
- }
- catch(e) {}
+ if (L.isObject(state) && state.page === page && L.isObject(state.paths))
+ return state;
+
+ session.setLocalData('tab', null);
- window.sessionStorage.removeItem('tab');
return { page: page, paths: {} };
},
/** @private */
setActiveTabId: function(pane, tabIndex) {
- var path = this.getPathForPane(pane);
+ var path = this.getPathForPane(pane),
+ state = this.getActiveTabState();
- try {
- var state = this.getActiveTabState();
- state.paths[path] = tabIndex;
-
- window.sessionStorage.setItem('tab', JSON.stringify(state));
- }
- catch (e) { return false; }
+ state.paths[path] = tabIndex;
- return true;
+ return session.setLocalData('tab', state);
},
/** @private */