|
|
@ -15,7 +15,8 @@ BI.Tab = BI.inherit(BI.Widget, { |
|
|
|
tab: false, |
|
|
|
tab: false, |
|
|
|
cardCreator: function (v) { |
|
|
|
cardCreator: function (v) { |
|
|
|
return BI.createWidget(); |
|
|
|
return BI.createWidget(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
keepAlives: [] |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -60,7 +61,7 @@ BI.Tab = BI.inherit(BI.Widget, { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
if (o.single === true) { |
|
|
|
if (o.single === true) { |
|
|
|
BI.each(this.cardMap, function (name, card) { |
|
|
|
BI.each(this.cardMap, function (name, card) { |
|
|
|
if (name !== (currCardName + "")) { |
|
|
|
if (name !== (currCardName + "") && self._keepAlive(name) !== true) { |
|
|
|
self.layout.deleteCardByName(name); |
|
|
|
self.layout.deleteCardByName(name); |
|
|
|
delete self.cardMap[name]; |
|
|
|
delete self.cardMap[name]; |
|
|
|
} |
|
|
|
} |
|
|
@ -76,6 +77,12 @@ BI.Tab = BI.inherit(BI.Widget, { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_keepAlive: function (v) { |
|
|
|
|
|
|
|
var o = this.options; |
|
|
|
|
|
|
|
var keepAlives = BI.isFunction(o.keepAlives) ? o.keepAlives() : o.keepAlives; |
|
|
|
|
|
|
|
return BI.contains(keepAlives, v); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
created: function () { |
|
|
|
created: function () { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
if (o.showIndex !== false) { |
|
|
|
if (o.showIndex !== false) { |
|
|
|