Fix edge case in sessionStorage detection for FireFox. If it is disabled using about:config, typeof will be object, but the value will be null.

This commit is contained in:
jakr 2012-07-24 12:54:23 +02:00
parent 36c8fc2e93
commit 3bc2798e72

View File

@ -441,7 +441,7 @@ jQuery.noConflict();
* Requires HTML5 sessionStorage support. * Requires HTML5 sessionStorage support.
*/ */
saveTabState: function() { saveTabState: function() {
if(typeof(window.sessionStorage)=="undefined") return; if(typeof(window.sessionStorage)=="undefined" || window.sessionStorage == null) return;
var selectedTabs = [], url = this._tabStateUrl(); var selectedTabs = [], url = this._tabStateUrl();
this.find('.cms-tabset,.ss-tabset').each(function(i, el) { this.find('.cms-tabset,.ss-tabset').each(function(i, el) {
@ -459,7 +459,7 @@ jQuery.noConflict();
* Requires HTML5 sessionStorage support. * Requires HTML5 sessionStorage support.
*/ */
restoreTabState: function() { restoreTabState: function() {
if(typeof(window.sessionStorage)=="undefined") return; if(typeof(window.sessionStorage)=="undefined" || window.sessionStorage == null) return;
var self = this, url = this._tabStateUrl(), var self = this, url = this._tabStateUrl(),
data = window.sessionStorage.getItem('tabs-' + url), data = window.sessionStorage.getItem('tabs-' + url),