|
|
@ -1,8 +1,9 @@ |
|
|
|
BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { |
|
|
|
BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { |
|
|
|
props: function () { |
|
|
|
props: function () { |
|
|
|
return BI.extend(BI.FloatHorizontalFillLayout.superclass.props.apply(this, arguments), { |
|
|
|
return BI.extend(BI.FloatHorizontalFillLayout.superclass.props.apply(this, arguments), { |
|
|
|
baseCls: "bi-h-float-fill", |
|
|
|
baseCls: "bi-h-float-fill bi-h-fill", |
|
|
|
verticalAlign: BI.VerticalAlign.Top, |
|
|
|
horizontalAlign: BI.HorizontalAlign.Stretch, |
|
|
|
|
|
|
|
verticalAlign: BI.VerticalAlign.Stretch, |
|
|
|
hgap: 0, |
|
|
|
hgap: 0, |
|
|
|
vgap: 0, |
|
|
|
vgap: 0, |
|
|
|
lgap: 0, |
|
|
|
lgap: 0, |
|
|
@ -30,6 +31,54 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
items = BI.compact(items); |
|
|
|
items = BI.compact(items); |
|
|
|
var rank = 0; |
|
|
|
var rank = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createWidget (i, item, desc) { |
|
|
|
|
|
|
|
if (o.verticalAlign !== BI.VerticalAlign.Stretch) { |
|
|
|
|
|
|
|
var w = BI._lazyCreateWidget({ |
|
|
|
|
|
|
|
type: "bi.vertical_adapt", |
|
|
|
|
|
|
|
horizontalAlign: BI.HorizontalAlign.Stretch, |
|
|
|
|
|
|
|
verticalAlign: o.verticalAlign, |
|
|
|
|
|
|
|
items: [item] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
var w = BI._lazyCreateWidget(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { |
|
|
|
|
|
|
|
w.element.css({ |
|
|
|
|
|
|
|
"margin-top": (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (desc) { |
|
|
|
|
|
|
|
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { |
|
|
|
|
|
|
|
w.element.css({ |
|
|
|
|
|
|
|
"margin-right": ((i === o.items.length - 1 ? o.hgap : 0) + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { |
|
|
|
|
|
|
|
w.element.css({ |
|
|
|
|
|
|
|
"margin-left": (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { |
|
|
|
|
|
|
|
w.element.css({ |
|
|
|
|
|
|
|
"margin-left": ((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { |
|
|
|
|
|
|
|
w.element.css({ |
|
|
|
|
|
|
|
"margin-right": (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { |
|
|
|
|
|
|
|
w.element.css({ |
|
|
|
|
|
|
|
"margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return w; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BI.any(items, function (i, item) { |
|
|
|
BI.any(items, function (i, item) { |
|
|
|
if (BI.isEmptyObject(item)) { |
|
|
|
if (BI.isEmptyObject(item)) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
@ -38,9 +87,9 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { |
|
|
|
if (columnSize === "fill") { |
|
|
|
if (columnSize === "fill") { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
var w = BI._lazyCreateWidget(item); |
|
|
|
var w = createWidget(i, item); |
|
|
|
self.addWidget(self._getChildName(rank++), w); |
|
|
|
self.addWidget(self._getChildName(rank++), w); |
|
|
|
w.element.addClass("h-float-fill-item"); |
|
|
|
w.element.addClass("h-fill-item"); |
|
|
|
w.element.css({ |
|
|
|
w.element.css({ |
|
|
|
float: "left", |
|
|
|
float: "left", |
|
|
|
position: "relative" |
|
|
|
position: "relative" |
|
|
@ -54,9 +103,9 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { |
|
|
|
if (columnSize === "fill") { |
|
|
|
if (columnSize === "fill") { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
var w = BI._lazyCreateWidget(item); |
|
|
|
var w = createWidget(i, item, true); |
|
|
|
self.addWidget(self._getChildName(rank++), w); |
|
|
|
self.addWidget(self._getChildName(rank++), w); |
|
|
|
w.element.addClass("h-float-fill-item"); |
|
|
|
w.element.addClass("h-fill-item"); |
|
|
|
w.element.css({ |
|
|
|
w.element.css({ |
|
|
|
float: "right", |
|
|
|
float: "right", |
|
|
|
position: "relative" |
|
|
|
position: "relative" |
|
|
@ -65,9 +114,9 @@ BI.FloatHorizontalFillLayout = BI.inherit(BI.Layout, { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
BI.each(items, function (i, item) { |
|
|
|
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; |
|
|
|
var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; |
|
|
|
if (columnSize === "fill") { |
|
|
|
if (columnSize === "fill") { |
|
|
|
var w = BI._lazyCreateWidget(item); |
|
|
|
var w = createWidget(i, item); |
|
|
|
self.addWidget(self._getChildName(rank++), w); |
|
|
|
self.addWidget(self._getChildName(rank++), w); |
|
|
|
w.element.addClass("h-float-fill-item").css({ |
|
|
|
w.element.addClass("h-fill-item").css({ |
|
|
|
position: "relative" |
|
|
|
position: "relative" |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|