forked from fanruan/fineui
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.
50 lines
1.4 KiB
50 lines
1.4 KiB
/** |
|
* 自适应水平和垂直方向都居中容器 |
|
* @class BI.CenterAdaptLayout |
|
* @extends BI.Layout |
|
*/ |
|
BI.CenterAdaptLayout = BI.inherit(BI.Layout, { |
|
props: function () { |
|
return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this, arguments), { |
|
baseCls: "bi-center-adapt-layout", |
|
columnSize: [], |
|
scrollx: false, |
|
hgap: 0, |
|
vgap: 0, |
|
lgap: 0, |
|
rgap: 0, |
|
tgap: 0, |
|
bgap: 0 |
|
}); |
|
}, |
|
render: function () { |
|
var o = this.options, self = this; |
|
BI.CenterAdaptLayout.superclass.render.apply(this, arguments); |
|
return { |
|
type: "bi.horizontal", |
|
verticalAlign: BI.VerticalAlign.Middle, |
|
horizontalAlign: BI.HorizontalAlign.Center, |
|
columnSize: o.columnSize, |
|
scrollx: o.scrollx, |
|
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 |
|
}; |
|
}, |
|
|
|
resize: function () { |
|
// console.log("center_adapt布局不需要resize"); |
|
}, |
|
|
|
populate: function (items) { |
|
this.layout.populate.apply(this, arguments); |
|
} |
|
}); |
|
BI.shortcut("bi.center_adapt", BI.CenterAdaptLayout); |