|
|
@ -15,43 +15,17 @@ BI.prepares.push(function () { |
|
|
|
}; |
|
|
|
}; |
|
|
|
BI.Plugin.configWidget("bi.horizontal", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.horizontal", function (ob) { |
|
|
|
var isIE = BI.isIE(), supportFlex = isSupportFlex(), isLessIE8 = isIE && BI.getIEVersion() < 8; |
|
|
|
var isIE = BI.isIE(), supportFlex = isSupportFlex(), isLessIE8 = isIE && BI.getIEVersion() < 8; |
|
|
|
// center_adapt
|
|
|
|
if (isLessIE8) { |
|
|
|
if (ob.verticalAlign === BI.VerticalAlign.Middle && ob.horizontalAlign === BI.HorizontalAlign.Center) { |
|
|
|
return ob; |
|
|
|
if (isLessIE8) { |
|
|
|
|
|
|
|
return ob; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.table_adapt"}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// vertical_adapt
|
|
|
|
|
|
|
|
if (ob.verticalAlign === BI.VerticalAlign.Middle && ob.horizontalAlign === BI.HorizontalAlign.Left) { |
|
|
|
|
|
|
|
if (isLessIE8) { |
|
|
|
|
|
|
|
return ob; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.table_adapt"}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// horizontal_adapt
|
|
|
|
|
|
|
|
if (ob.verticalAlign === BI.VerticalAlign.Top && ob.horizontalAlign === BI.HorizontalAlign.Center) { |
|
|
|
|
|
|
|
if (isLessIE8) { |
|
|
|
|
|
|
|
return ob; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.table_adapt"}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (!isIE) { |
|
|
|
if (IE || !supportFlex || (ob.items && ob.items.length > 1)) { |
|
|
|
if (supportFlex) { |
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.flex_horizontal"}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.table_adapt"}); |
|
|
|
return BI.extend(ob, {type: "bi.table_adapt"}); |
|
|
|
} |
|
|
|
} |
|
|
|
return ob; |
|
|
|
return BI.extend(ob, {type: "bi.flex_horizontal"}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Plugin.configWidget("bi.center_adapt", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.center_adapt", function (ob) { |
|
|
|
var isIE = BI.isIE(), supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); |
|
|
|
var isIE = BI.isIE(), supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); |
|
|
|
if (!isIE && supportFlex && justOneItem) { |
|
|
|
if (!isIE && supportFlex && justOneItem) { |
|
|
|
// 有滚动条的情况下需要用到flex_scrollable_center_adapt布局
|
|
|
|
|
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
|
|
|
|
// 不是IE用flex_scrollable_center_adapt布局
|
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.flex_scrollable_center_adapt"}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.flex_center_adapt"}); |
|
|
|
return BI.extend(ob, {type: "bi.flex_center_adapt"}); |
|
|
|
} |
|
|
|
} |
|
|
|
// 一个item的情况下inline布局睥睨天下
|
|
|
|
// 一个item的情况下inline布局睥睨天下
|
|
|
@ -63,60 +37,50 @@ BI.prepares.push(function () { |
|
|
|
BI.Plugin.configWidget("bi.vertical_adapt", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.vertical_adapt", function (ob) { |
|
|
|
var isIE = BI.isIE(), supportFlex = isSupportFlex(); |
|
|
|
var isIE = BI.isIE(), supportFlex = isSupportFlex(); |
|
|
|
if (!isIE && supportFlex) { |
|
|
|
if (!isIE && supportFlex) { |
|
|
|
// 有滚动条的情况下需要用到flex_scrollable_center_adapt布局
|
|
|
|
|
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
|
|
|
|
// 不是IE用flex__scrollable_center_adapt布局
|
|
|
|
|
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_center_adapt"}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.flex_vertical_center_adapt"}); |
|
|
|
return BI.extend(ob, {type: "bi.flex_vertical_center_adapt"}); |
|
|
|
} |
|
|
|
} |
|
|
|
return BI.extend(ob, {type: "bi.inline_vertical_adapt"}); |
|
|
|
return BI.extend(ob, {type: "bi.inline_vertical_adapt"}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Plugin.configWidget("bi.horizontal_adapt", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.horizontal_adapt", function (ob) { |
|
|
|
if (ob.items && ob.items.length <= 1) { |
|
|
|
if (ob.verticalAlign === BI.VerticalAlign.TOP && ob.items && ob.items.length <= 1) { |
|
|
|
return BI.extend(ob, {type: "bi.horizontal_auto"}); |
|
|
|
return BI.extend(ob, {type: "bi.horizontal_auto"}); |
|
|
|
} |
|
|
|
} |
|
|
|
return ob; |
|
|
|
return ob; |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Plugin.configWidget("bi.float_center_adapt", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.float_center_adapt", function (ob) { |
|
|
|
if (!BI.isIE() && isSupportFlex()) { |
|
|
|
if (!BI.isIE() && isSupportFlex()) { |
|
|
|
// 有滚动条的情况下需要用到flex_scrollable_center_adapt布局
|
|
|
|
|
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
|
|
|
|
// 不是IE用flex_scrollable_center_adapt布局
|
|
|
|
|
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return BI.extend(ob, {type: "bi.flex_center_adapt"}); |
|
|
|
return BI.extend(ob, {type: "bi.flex_center_adapt"}); |
|
|
|
} |
|
|
|
} |
|
|
|
return BI.extend(ob, {type: "bi.inline_center_adapt"}); |
|
|
|
return BI.extend(ob, {type: "bi.inline_center_adapt"}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.Plugin.configWidget("bi.flex_horizontal", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.flex_horizontal", function (ob) { |
|
|
|
if (ob.scrollable === true || ob.scrolly === true) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"}); |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Plugin.configWidget("bi.flex_vertical", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.flex_vertical", function (ob) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"}); |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Plugin.configWidget("bi.flex_horizontal_adapt", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.flex_horizontal_adapt", function (ob) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"}); |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Plugin.configWidget("bi.flex_vertical_adapt", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.flex_vertical_adapt", function (ob) { |
|
|
|
if (ob.scrollable === true || ob.scrolly === true) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"}); |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Plugin.configWidget("bi.flex_horizontal_center_adapt", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.flex_horizontal_center_adapt", function (ob) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"}); |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.Plugin.configWidget("bi.flex_vertical_center_adapt", function (ob) { |
|
|
|
BI.Plugin.configWidget("bi.flex_vertical_center_adapt", function (ob) { |
|
|
|
if (ob.scrollable === true || ob.scrolly === true) { |
|
|
|
if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) { |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"}); |
|
|
|
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|