|
|
|
@ -14342,6 +14342,10 @@ BI.Widget = BI.inherit(BI.OB, {
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
update: function () { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
destroyed: function () { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -14666,10 +14670,7 @@ BI.Widget = BI.inherit(BI.OB, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
destroy: function () { |
|
|
|
|
this.empty(); |
|
|
|
|
this._isMounted = false; |
|
|
|
|
this._parent = null; |
|
|
|
|
this.destroyed(); |
|
|
|
|
this._unMount(); |
|
|
|
|
this.element.destroy(); |
|
|
|
|
this.fireEvent(BI.Events.DESTROY); |
|
|
|
|
} |
|
|
|
@ -19320,35 +19321,117 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getChildName: function (index) { |
|
|
|
|
return index + ""; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_addElement: function (i, item) { |
|
|
|
|
var o = this.options; |
|
|
|
|
var w; |
|
|
|
|
if (!this.hasWidget(this.getName() + "-" + i)) { |
|
|
|
|
var self = this, w; |
|
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
|
w = BI.createWidget(item); |
|
|
|
|
this.addWidget(this.getName() + "-" + i, w); |
|
|
|
|
this.addWidget(this._getChildName(i), w); |
|
|
|
|
w.on(BI.Events.DESTROY, function () { |
|
|
|
|
BI.each(self._children, function (name, child) { |
|
|
|
|
if (child === w) { |
|
|
|
|
self.removeItemAt(name | 0); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
w = this.getWidgetByName(this.getName() + "-" + i); |
|
|
|
|
w = this.getWidgetByName(this._getChildName(i)); |
|
|
|
|
} |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
stroke: function (items) { |
|
|
|
|
_getOptions: function (item) { |
|
|
|
|
if (item instanceof BI.Widget) { |
|
|
|
|
item = item.options; |
|
|
|
|
} |
|
|
|
|
item = BI.stripEL(item); |
|
|
|
|
if (item instanceof BI.Widget) { |
|
|
|
|
item = item.options; |
|
|
|
|
} |
|
|
|
|
return item; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_compare: function (item1, item2) { |
|
|
|
|
var self = this; |
|
|
|
|
BI.each(items, function (i, item) { |
|
|
|
|
if (!!item) { |
|
|
|
|
self._addElement(i, item); |
|
|
|
|
return eq(item1, item2); |
|
|
|
|
|
|
|
|
|
//不比较函数
|
|
|
|
|
function eq(a, b, aStack, bStack) { |
|
|
|
|
if (a === b) return a !== 0 || 1 / a === 1 / b; |
|
|
|
|
if (a == null || b == null) return a === b; |
|
|
|
|
var className = Object.prototype.toString.call(a); |
|
|
|
|
switch (className) { |
|
|
|
|
case '[object RegExp]': |
|
|
|
|
case '[object String]': |
|
|
|
|
return '' + a === '' + b; |
|
|
|
|
case '[object Number]': |
|
|
|
|
if (+a !== +a) return +b !== +b; |
|
|
|
|
return +a === 0 ? 1 / +a === 1 / b : +a === +b; |
|
|
|
|
case '[object Date]': |
|
|
|
|
case '[object Boolean]': |
|
|
|
|
return +a === +b; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var areArrays = className === '[object Array]'; |
|
|
|
|
if (!areArrays) { |
|
|
|
|
if (BI.isFunction(a) && BI.isFunction(b)) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
a = self._getOptions(a); |
|
|
|
|
b = self._getOptions(b); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
aStack = aStack || []; |
|
|
|
|
bStack = bStack || []; |
|
|
|
|
var length = aStack.length; |
|
|
|
|
while (length--) { |
|
|
|
|
if (aStack[length] === a) return bStack[length] === b; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
aStack.push(a); |
|
|
|
|
bStack.push(b); |
|
|
|
|
|
|
|
|
|
if (areArrays) { |
|
|
|
|
length = a.length; |
|
|
|
|
if (length !== b.length) return false; |
|
|
|
|
while (length--) { |
|
|
|
|
if (!eq(a[length], b[length], aStack, bStack)) return false; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
var keys = _.keys(a), key; |
|
|
|
|
length = keys.length; |
|
|
|
|
if (_.keys(b).length !== length) return false; |
|
|
|
|
while (length--) { |
|
|
|
|
key = keys[length]; |
|
|
|
|
if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
aStack.pop(); |
|
|
|
|
bStack.pop(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
|
var self = this; |
|
|
|
|
this.options.items = items || []; |
|
|
|
|
this.stroke(items); |
|
|
|
|
_getWrapper: function () { |
|
|
|
|
return this.element; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
resize: function () { |
|
|
|
|
_addItem: function (index, item) { |
|
|
|
|
for (var i = this.options.items.length; i > index; i--) { |
|
|
|
|
this._children[this._getChildName(i)] = this._children[this._getChildName(i - 1)]; |
|
|
|
|
} |
|
|
|
|
delete this._children[index]; |
|
|
|
|
this.options.items.splice(index, 0, item); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_removeItem: function (index) { |
|
|
|
|
for (var i = index; i < this.options.items.length - 1; i++) { |
|
|
|
|
this._children[this._getChildName(i)] = this._children[this._getChildName(i + 1)]; |
|
|
|
|
} |
|
|
|
|
this.options.items.splice(index, 1); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -19358,7 +19441,7 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
addItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.push(item); |
|
|
|
|
w.element.appendTo(this.element); |
|
|
|
|
w.element.appendTo(this._getWrapper()); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
@ -19366,11 +19449,54 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
prependItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.unshift(item); |
|
|
|
|
w.element.prependTo(this.element); |
|
|
|
|
w.element.prependTo(this._getWrapper()); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItemAt: function (index, item) { |
|
|
|
|
if (index < 0 || index > this.options.items.length) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this._addItem(index, item); |
|
|
|
|
var w = this._addElement(index, item); |
|
|
|
|
if (index > 0) { |
|
|
|
|
this._children[this._getChildName(index - 1)].element.after(w.element); |
|
|
|
|
} else { |
|
|
|
|
w.element.prependTo(this._getWrapper()); |
|
|
|
|
} |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
removeItemAt: function (index) { |
|
|
|
|
if (index < 0 || index > this.options.items.length - 1) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this._children[this._getChildName(index)].destroy(); |
|
|
|
|
this._removeItem(index); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
updateItemAt: function (index, item) { |
|
|
|
|
if (index < 0 || index > this.options.items.length - 1) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var updated; |
|
|
|
|
if (updated = this._children[this._getChildName(index)].update(this._getOptions(item))) { |
|
|
|
|
return updated; |
|
|
|
|
} |
|
|
|
|
this._children[this._getChildName(index)].destroy(); |
|
|
|
|
var w = this._addElement(index, item); |
|
|
|
|
this._children[this._getChildName(index)] = w; |
|
|
|
|
if (index > 0) { |
|
|
|
|
this._children[this._getChildName(index - 1)].element.after(w.element); |
|
|
|
|
} else { |
|
|
|
|
w.element.prependTo(this._getWrapper()); |
|
|
|
|
} |
|
|
|
|
w._mount(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItems: function (items) { |
|
|
|
|
var self = this; |
|
|
|
|
BI.each(items, function (i, item) { |
|
|
|
@ -19386,9 +19512,9 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getValue: function () { |
|
|
|
|
var value = []; |
|
|
|
|
BI.each(this._children, function (i, wi) { |
|
|
|
|
var v = wi.getValue(); |
|
|
|
|
var self = this, value = []; |
|
|
|
|
BI.each(this.options.items, function (i) { |
|
|
|
|
var v = self._children[self._getChildName(i)].getValue(); |
|
|
|
|
v = BI.isArray(v) ? v : [v]; |
|
|
|
|
value = value.concat(v); |
|
|
|
|
}); |
|
|
|
@ -19396,15 +19522,63 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
|
BI.each(this._children, function (i, wi) { |
|
|
|
|
wi.setValue(v); |
|
|
|
|
var self = this; |
|
|
|
|
BI.each(this.options.items, function (i) { |
|
|
|
|
self._children[self._getChildName(i)].setValue(v); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setText: function (v) { |
|
|
|
|
BI.each(this._children, function (i, wi) { |
|
|
|
|
wi.setText(v); |
|
|
|
|
var self = this; |
|
|
|
|
BI.each(this.options.items, function (i) { |
|
|
|
|
self._children[self._getChildName(i)].setText(v); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
update: function (item) { |
|
|
|
|
var o = this.options; |
|
|
|
|
var items = item.items; |
|
|
|
|
var updated = false, i, len; |
|
|
|
|
for (i = 0, len = o.items.length; i < len; i++) { |
|
|
|
|
if (!this._compare(o.items[i], items[i])) { |
|
|
|
|
updated = this.updateItemAt(i, items[i]) || updated; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (o.items.length > items.length) { |
|
|
|
|
for (i = items.length; i < o.items.length; i++) { |
|
|
|
|
this.removeItemAt(i); |
|
|
|
|
} |
|
|
|
|
} else if (items.length > o.items.length) { |
|
|
|
|
for (i = o.items.length; i < items.length; i++) { |
|
|
|
|
this.addItemAt(i, items[i]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.options.items = items; |
|
|
|
|
return updated; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
stroke: function (items) { |
|
|
|
|
var self = this; |
|
|
|
|
BI.each(items, function (i, item) { |
|
|
|
|
if (!!item) { |
|
|
|
|
self._addElement(i, item); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
items = items || []; |
|
|
|
|
if (this._isMounted) { |
|
|
|
|
this.update({items: items}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.options.items = items; |
|
|
|
|
this.stroke(items); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
resize: function () { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$.shortcut('bi.layout', BI.Layout);/** |
|
|
|
@ -24978,7 +25152,7 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
var o = this.options; |
|
|
|
|
var td; |
|
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
|
if (!this.hasWidget(this.getName() + "-" + i)) { |
|
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
|
var w = BI.createWidget(item); |
|
|
|
|
w.element.css({"position": "relative", "top": "0", "left": "0", "margin": "0px auto"}); |
|
|
|
|
td = BI.createWidget({ |
|
|
|
@ -24989,9 +25163,9 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
}, |
|
|
|
|
items: [w] |
|
|
|
|
}); |
|
|
|
|
this.addWidget(this.getName() + "-" + i, td); |
|
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
|
} else { |
|
|
|
|
td = this.getWidgetByName(this.getName() + "-" + i); |
|
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
|
|
td.element.attr("width", width); |
|
|
|
|
} |
|
|
|
|
td.element.css({"max-width": o.columnSize[i]}); |
|
|
|
@ -25049,20 +25223,8 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
// console.log("center_adapt布局不需要resize");
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.push(item); |
|
|
|
|
w.element.appendTo(this.$tr); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
prependItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.unshift(item); |
|
|
|
|
w.element.appendTo(this.$tr); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
_getWrapper: function(){ |
|
|
|
|
return this.$tr; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
@ -25108,7 +25270,7 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
var o = this.options; |
|
|
|
|
var td; |
|
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
|
if (!this.hasWidget(this.getName() + "-" + i)) { |
|
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
|
var w = BI.createWidget(item); |
|
|
|
|
w.element.css({"position": "relative", "top": "0", "left": "0", "margin": "0px auto"}); |
|
|
|
|
td = BI.createWidget({ |
|
|
|
@ -25119,9 +25281,9 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
}, |
|
|
|
|
items: [w] |
|
|
|
|
}); |
|
|
|
|
this.addWidget(this.getName() + "-" + i, td); |
|
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
|
} else { |
|
|
|
|
td = this.getWidgetByName(this.getName() + "-" + i); |
|
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
|
|
td.element.attr("width", width); |
|
|
|
|
} |
|
|
|
|
td.element.css({"max-width": o.columnSize[i] + "px"}); |
|
|
|
@ -25178,20 +25340,8 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
// console.log("horizontal_adapt布局不需要resize");
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.push(item); |
|
|
|
|
w.element.appendTo(this.$tr); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
prependItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.unshift(item); |
|
|
|
|
w.element.appendTo(this.$tr); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
_getWrapper: function () { |
|
|
|
|
return this.$tr; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
@ -25406,7 +25556,7 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
var o = this.options; |
|
|
|
|
var td; |
|
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
|
if (!this.hasWidget(this.getName() + "-" + i)) { |
|
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
|
var w = BI.createWidget(item); |
|
|
|
|
w.element.css({"position": "relative", "top": "0", "left": "0", "margin": "0px auto"}); |
|
|
|
|
td = BI.createWidget({ |
|
|
|
@ -25417,9 +25567,9 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
}, |
|
|
|
|
items: [w] |
|
|
|
|
}); |
|
|
|
|
this.addWidget(this.getName() + "-" + i, td); |
|
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
|
} else { |
|
|
|
|
td = this.getWidgetByName(this.getName() + "-" + i); |
|
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
|
|
td.element.attr("width", width); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -25473,20 +25623,8 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.push(item); |
|
|
|
|
w.element.appendTo(this.$tr); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
prependItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.unshift(item); |
|
|
|
|
w.element.appendTo(this.$tr); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
_getWrapper: function(){ |
|
|
|
|
return this.$tr; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
resize: function () { |
|
|
|
@ -26063,20 +26201,8 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.push(item); |
|
|
|
|
w.element.appendTo(this.$wrapper); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
prependItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.unshift(item); |
|
|
|
|
w.element.appendTo(this.$wrapper); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
_getWrapper: function(){ |
|
|
|
|
return this.$wrapper; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
resize: function () { |
|
|
|
@ -26160,20 +26286,8 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.push(item); |
|
|
|
|
w.element.appendTo(this.$wrapper); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
prependItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.unshift(item); |
|
|
|
|
w.element.appendTo(this.$wrapper); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
_getWrapper: function(){ |
|
|
|
|
return this.$wrapper; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
resize: function () { |
|
|
|
@ -26255,20 +26369,8 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, {
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.push(item); |
|
|
|
|
w.element.appendTo(this.$wrapper); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
prependItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
this.options.items.unshift(item); |
|
|
|
|
w.element.appendTo(this.$wrapper); |
|
|
|
|
w._mount(); |
|
|
|
|
return w; |
|
|
|
|
_getWrapper: function(){ |
|
|
|
|
return this.$wrapper; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
resize: function () { |
|
|
|
@ -27275,7 +27377,7 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
var o = this.options; |
|
|
|
|
var td; |
|
|
|
|
var width = o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]; |
|
|
|
|
if (!this.hasWidget(this.getName() + i)) { |
|
|
|
|
if (!this.hasWidget(this._getChildName(i))) { |
|
|
|
|
var w = BI.createWidget(item); |
|
|
|
|
w.element.css({"position": "relative", "margin": "0px auto"}); |
|
|
|
|
td = BI.createWidget({ |
|
|
|
@ -27286,9 +27388,9 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
}, |
|
|
|
|
items: [w] |
|
|
|
|
}); |
|
|
|
|
this.addWidget(this.getName() + i, td); |
|
|
|
|
this.addWidget(this._getChildName(i), td); |
|
|
|
|
} else { |
|
|
|
|
td = this.getWidgetByName(this.getName() + i); |
|
|
|
|
td = this.getWidgetByName(this._getChildName(i)); |
|
|
|
|
td.element.attr("width", width); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -27346,12 +27448,8 @@ BI.HorizontalLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
// console.log("horizontal layout do not need to resize");
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItem: function (item) { |
|
|
|
|
var w = this._addElement(this.options.items.length, item); |
|
|
|
|
w._mount(); |
|
|
|
|
this.options.items.push(item); |
|
|
|
|
w.element.appendTo(this.$tr); |
|
|
|
|
return w; |
|
|
|
|
_getWrapper: function(){ |
|
|
|
|
return this.$tr; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
populate: function (items) { |
|
|
|
@ -27522,6 +27620,12 @@ BI.LatticeLayout = BI.inherit(BI.Layout, {
|
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
addItemAt: function (item) { |
|
|
|
|
var w = BI.LatticeLayout.superclass.addItemAt.apply(this, arguments); |
|
|
|
|
this.resize(); |
|
|
|
|
return w; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
resize: function () { |
|
|
|
|
this.stroke(this.options.items); |
|
|
|
|
}, |
|
|
|
|