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.

54 lines
1.5 KiB

8 years ago
/**
* 自适应水平和垂直方向都居中容器
* @class BI.CenterAdaptLayout
* @extends BI.Layout
*/
BI.CenterAdaptLayout = BI.inherit(BI.Layout, {
8 years ago
props: function () {
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), {
4 years ago
baseCls: "bi-c-a",
horizontalAlign: BI.HorizontalAlign.Center,
8 years ago
columnSize: [],
7 years ago
scrollx: false,
8 years ago
hgap: 0,
vgap: 0,
lgap: 0,
rgap: 0,
tgap: 0,
bgap: 0
});
},
8 years ago
render: function () {
7 years ago
var o = this.options, self = this;
8 years ago
BI.CenterAdaptLayout.superclass.render.apply(this, arguments);
7 years ago
return {
type: "bi.horizontal",
verticalAlign: BI.VerticalAlign.Middle,
horizontalAlign: o.horizontalAlign,
7 years ago
columnSize: o.columnSize,
scrollx: o.scrollx,
5 years ago
scrolly: o.scrolly,
scrollable: o.scrollable,
7 years ago
items: o.items,
ref: function (_ref) {
self.layout = _ref;
},
hgap: o.hgap,
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
};
8 years ago
},
resize: function () {
this.layout.resize();
},
8 years ago
populate: function (items) {
7 years ago
this.layout.populate.apply(this, arguments);
8 years ago
}
});
5 years ago
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout);