|
@@ -59,8 +59,8 @@ if (typeof jQuery === "undefined") {
|
|
|
return t;
|
|
return t;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- supportStorage = function () {
|
|
|
|
|
- return !(sessionStorage === undefined);
|
|
|
|
|
|
|
+ supportStorage = function (is_cache) {
|
|
|
|
|
+ return !(sessionStorage === undefined) && is_cache;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -572,12 +572,12 @@ if (typeof jQuery === "undefined") {
|
|
|
options = self.options,
|
|
options = self.options,
|
|
|
storage, init = options.init,
|
|
storage, init = options.init,
|
|
|
param;
|
|
param;
|
|
|
- if (supportStorage) {
|
|
|
|
|
- //storage = self._storage();
|
|
|
|
|
- //self._resetStorage({});
|
|
|
|
|
- //$.each(storage, function (k, v) {
|
|
|
|
|
- // self.create(v, false);
|
|
|
|
|
- //})
|
|
|
|
|
|
|
+ if (supportStorage(options.cache)) {
|
|
|
|
|
+ storage = self._storage();
|
|
|
|
|
+ self._resetStorage({});
|
|
|
|
|
+ $.each(storage, function (k, v) {
|
|
|
|
|
+ self.create(v, false);
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
if ($.isEmptyObject(storage)) {
|
|
if ($.isEmptyObject(storage)) {
|
|
|
init = (!$.isEmptyObject(init) && init instanceof Array) ? init : defaultInit;
|
|
init = (!$.isEmptyObject(init) && init instanceof Array) ? init : defaultInit;
|
|
@@ -786,7 +786,7 @@ if (typeof jQuery === "undefined") {
|
|
|
* @private
|
|
* @private
|
|
|
*/
|
|
*/
|
|
|
_storage: function (key, param) {
|
|
_storage: function (key, param) {
|
|
|
- if (supportStorage()) {
|
|
|
|
|
|
|
+ if (supportStorage(this.options.cache)) {
|
|
|
var storage = JSON.parse(sessionStorage.multitabs || '{}');
|
|
var storage = JSON.parse(sessionStorage.multitabs || '{}');
|
|
|
if (!key) {
|
|
if (!key) {
|
|
|
return storage;
|
|
return storage;
|
|
@@ -807,7 +807,7 @@ if (typeof jQuery === "undefined") {
|
|
|
* @private
|
|
* @private
|
|
|
*/
|
|
*/
|
|
|
_delStorage: function (key) {
|
|
_delStorage: function (key) {
|
|
|
- if (supportStorage()) {
|
|
|
|
|
|
|
+ if (supportStorage(this.options.cache)) {
|
|
|
var storage = JSON.parse(sessionStorage.multitabs || '{}');
|
|
var storage = JSON.parse(sessionStorage.multitabs || '{}');
|
|
|
if (!key) {
|
|
if (!key) {
|
|
|
return storage;
|
|
return storage;
|
|
@@ -825,7 +825,7 @@ if (typeof jQuery === "undefined") {
|
|
|
* @private
|
|
* @private
|
|
|
*/
|
|
*/
|
|
|
_resetStorage: function (storage) {
|
|
_resetStorage: function (storage) {
|
|
|
- if (supportStorage() && typeof storage === "object") {
|
|
|
|
|
|
|
+ if (supportStorage(this.options.cache) && typeof storage === "object") {
|
|
|
sessionStorage.multitabs = JSON.stringify(storage);
|
|
sessionStorage.multitabs = JSON.stringify(storage);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -1006,6 +1006,7 @@ if (typeof jQuery === "undefined") {
|
|
|
$.fn.multitabs.defaults = {
|
|
$.fn.multitabs.defaults = {
|
|
|
selector: '.multitabs', //selector text to trigger multitabs.
|
|
selector: '.multitabs', //selector text to trigger multitabs.
|
|
|
iframe: false, //Global iframe mode, default is false, is the auto mode (for the self page, use ajax, and the external, use iframe)
|
|
iframe: false, //Global iframe mode, default is false, is the auto mode (for the self page, use ajax, and the external, use iframe)
|
|
|
|
|
+ cache: false,
|
|
|
class: '', //class for whole multitabs
|
|
class: '', //class for whole multitabs
|
|
|
type: 'info', //change the info content name, is not necessary to change.
|
|
type: 'info', //change the info content name, is not necessary to change.
|
|
|
init: [],
|
|
init: [],
|