Browse Source

Pull request #2790: feature: vertical支持horizontalAlign设置

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'd9749ad7a798c175f56e1c3e80ffe996cc97b847':
  feature: vertical支持horizontalAlign设置
es6
guy 2 years ago
parent
commit
9f4d1470d1
  1. 19
      src/core/platform/web/config.js

19
src/core/platform/web/config.js

@ -45,6 +45,25 @@ BI.prepares.push(function () {
scrollx: true scrollx: true
}, ob, {type: "bi.inline"}); }, ob, {type: "bi.inline"});
}); });
BI.Plugin.configWidget("bi.vertical", function (ob) {
if (ob.horizontalAlign === BI.HorizontalAlign.Left || ob.horizontalAlign === BI.HorizontalAlign.Right) {
if (isSupportFlex()) {
return BI.extend({}, ob, {type: "bi.flex_vertical"});
}
return BI.extend({}, ob, {
horizontalAlign: BI.HorizontalAlign.Stretch,
type: "bi.vertical",
items: BI.map(ob.items, function (item) {
return {
type: "bi.inline",
horizontalAlign: ob.horizontalAlign,
items: [item]
};
})
});
}
return ob;
});
BI.Plugin.configWidget("bi.inline", function (ob) { BI.Plugin.configWidget("bi.inline", function (ob) {
// 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧 // 当列宽既需要自动列宽又需要自适应列宽时,inline布局也处理不了了,降级table处理吧
var hasAutoAndFillColumnSize = false; var hasAutoAndFillColumnSize = false;

Loading…
Cancel
Save