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.

48 lines
1.9 KiB

7 years ago
// 工程配置
7 years ago
(function () {
7 years ago
// 注册布局
8 years ago
var isSupportFlex = BI.isSupportCss3("flex");
BI.Plugin.registerWidget("bi.horizontal", function (ob) {
if (!BI.isIE() && isSupportFlex) {
8 years ago
return BI.extend(ob, {type: "bi.flex_horizontal"});
}
7 years ago
return ob;
7 years ago
8 years ago
});
BI.Plugin.registerWidget("bi.center_adapt", function (ob) {
if (!BI.isIE() && isSupportFlex && ob.items && ob.items.length <= 1) {
7 years ago
// 有滚动条的情况下需要用到flex_wrapper_center布局
8 years ago
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
7 years ago
// 不是IE用flex_wrapper_center布局
return BI.extend(ob, {type: "bi.flex_wrapper_center"});
8 years ago
}
return BI.extend(ob, {type: "bi.flex_center"});
}
7 years ago
return ob;
7 years ago
8 years ago
});
BI.Plugin.registerWidget("bi.vertical_adapt", function (ob) {
if (!BI.isIE() && isSupportFlex) {
7 years ago
// 有滚动条的情况下需要用到flex_wrapper_center布局
8 years ago
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
7 years ago
// 不是IE用flex_wrapper_center布局
return BI.extend({}, ob, {type: "bi.flex_wrapper_vertical_center"});
8 years ago
}
8 years ago
return BI.extend(ob, {type: "bi.flex_vertical_center"});
}
7 years ago
return ob;
7 years ago
8 years ago
});
BI.Plugin.registerWidget("bi.float_center_adapt", function (ob) {
if (!BI.isIE() && isSupportFlex) {
7 years ago
// 有滚动条的情况下需要用到flex_wrapper_center布局
8 years ago
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
7 years ago
// 不是IE用flex_wrapper_center布局
return BI.extend({}, ob, {type: "bi.flex_wrapper_center"});
8 years ago
}
return BI.extend(ob, {type: "bi.flex_center"});
}
7 years ago
return ob;
7 years ago
8 years ago
});
7 years ago
}());