fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
/**
|
|
|
|
* absolute实现的居中布局
|
|
|
|
* @class BI.AbsoluteCenterLayout
|
|
|
|
* @extends BI.Layout
|
|
|
|
*/
|
|
|
|
BI.AbsoluteCenterLayout = BI.inherit(BI.Layout, {
|
|
|
|
props: function () {
|
|
|
|
return BI.extend(BI.AbsoluteCenterLayout.superclass.props.apply(this, arguments), {
|
|
|
|
baseCls: "bi-absolute-center-layout",
|
|
|
|
hgap: 0,
|
|
|
|
lgap: 0,
|
|
|
|
rgap: 0,
|
|
|
|
vgap: 0,
|
|
|
|
tgap: 0,
|
|
|
|
bgap: 0
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
created: function () {
|
|
|
|
BI.AbsoluteCenterLayout.superclass.created.apply(this, arguments);
|
|
|
|
this.populate(this.options.items);
|
|
|
|
},
|
|
|
|
|
|
|
|
_addElement: function (i, item) {
|
|
|
|
var o = this.options;
|
|
|
|
var w = BI.AbsoluteCenterLayout.superclass._addElement.apply(this, arguments);
|
|
|
|
w.element.css({
|
|
|
|
"position": "absolute",
|
|
|
|
"left": o.hgap + o.lgap + (item.lgap || 0),
|
|
|
|
"right": o.hgap + o.rgap + (item.rgap || 0),
|
|
|
|
"top": o.vgap + o.tgap + (item.tgap || 0),
|
|
|
|
"bottom": o.vgap + o.bgap + (item.bgap || 0),
|
|
|
|
"margin": "auto"
|
|
|
|
});
|
|
|
|
return w;
|
|
|
|
},
|
|
|
|
|
|
|
|
resize: function () {
|
|
|
|
// console.log("absolute_center_adapt布局不需要resize");
|
|
|
|
},
|
|
|
|
|
|
|
|
populate: function (items) {
|
|
|
|
BI.AbsoluteCenterLayout.superclass.populate.apply(this, arguments);
|
|
|
|
this._mount();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$.shortcut('bi.absolute_center_adapt', BI.AbsoluteCenterLayout);
|