diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index 8206274a3..ea1c29cf6 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -26,14 +26,14 @@ BI.prepares.push(function () { if (!isIE && supportFlex) { return BI.extend({}, ob, {type: "bi.flex_horizontal"}); } - // 解决使用inline_vertical_adapt的顺序问题 - // 从右往左放置时,为了兼容,我们统一采用从右到左的放置方式 - if (ob.horizontalAlign === BI.HorizontalAlign.Right) { - return BI.extend({verticalAlign: BI.VerticalAlign.Top}, ob, { - type: "bi.inline_vertical_adapt", - items: ob.items && ob.items.reverse() - }); - } + // // 解决使用inline_vertical_adapt的顺序问题 + // // 从右往左放置时,为了兼容,我们统一采用从右到左的放置方式 + // if (ob.horizontalAlign === BI.HorizontalAlign.Right) { + // return BI.extend({verticalAlign: BI.VerticalAlign.Top}, ob, { + // type: "bi.inline_vertical_adapt", + // items: ob.items && ob.items.reverse() + // }); + // } return BI.extend({}, ob, {type: "bi.table_adapt"}); }); BI.Plugin.configWidget("bi.center_adapt", function (ob) { @@ -43,9 +43,6 @@ BI.prepares.push(function () { if (!isIE && supportFlex) { return BI.extend({}, ob, {type: "bi.flex_center_adapt"}); } - if (ob.horizontalAlign === BI.HorizontalAlign.Right) { - return BI.extend({}, ob, {type: "bi.inline_center_adapt", items: ob.items && ob.items.reverse()}); - } return BI.extend({}, ob, {type: "bi.inline_center_adapt"}); } return ob; @@ -57,9 +54,6 @@ BI.prepares.push(function () { if (!isIE && supportFlex) { return BI.extend({}, ob, {type: "bi.flex_vertical_center_adapt"}); } - if (ob.horizontalAlign === BI.HorizontalAlign.Right) { - return BI.extend({}, ob, {type: "bi.inline_vertical_adapt", items: ob.items && ob.items.reverse()}); - } return BI.extend({}, ob, {type: "bi.inline_vertical_adapt"}); } return ob; diff --git a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js index ca850fe2b..8d9a9f8cb 100644 --- a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js @@ -163,7 +163,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { self.layout = _ref; }, horizontalAlign: BI.HorizontalAlign.Right, - items: o.items.reverse(), + items: o.items, hgap: o.hgap, lgap: o.lgap, rgap: o.rgap, @@ -186,7 +186,7 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, populate: function (items) { - this.layout.populate(items.reverse()); + this.layout.populate(items); } }); BI.shortcut("bi.right_vertical_adapt", BI.RightVerticalAdaptLayout); diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index 32de79a2d..89550608d 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -54,12 +54,12 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { } if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-left": ((o.horizontalAlign === BI.HorizontalAlign.Right ? o.hgap : (i === 0 ? o.hgap : 0)) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-left": ((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit }); } if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-right": ((o.horizontalAlign === BI.HorizontalAlign.Right ? (i === 0 ? o.hgap : 0) : o.hgap) + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-right": (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit }); } if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 66f5702ef..28d8fd222 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -48,7 +48,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { } if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { w.element.css({ - "margin-top": ((o.verticalAlign === BI.VerticalAlign.Bottom ? o.vgap : (i === 0 ? o.vgap : 0)) + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-top": ((i === 0 ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit }); } if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { @@ -63,7 +63,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { } if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { w.element.css({ - "margin-bottom": ((o.verticalAlign === BI.VerticalAlign.Bottom ? (i === 0 ? o.vgap : 0) : o.vgap) + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit }); } return w; diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js index 1d9e74453..064560b5d 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -55,12 +55,12 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { } if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-left": ((o.horizontalAlign === BI.HorizontalAlign.Right ? o.hgap : (i === 0 ? o.hgap : 0)) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-left": ((i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit }); } if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-right": ((o.horizontalAlign === BI.HorizontalAlign.Right ? (i === 0 ? o.hgap : 0) : o.hgap) + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-right": (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit }); } if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js index 83b2e4606..3e170b9a7 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -50,7 +50,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { } if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) { w.element.css({ - "margin-top": ((o.verticalAlign === BI.VerticalAlign.Bottom ? o.vgap : (i === 0 ? o.vgap : 0)) + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-top": ((i === 0 ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit }); } if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { @@ -65,7 +65,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { } if (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0) !== 0) { w.element.css({ - "margin-bottom": ((o.verticalAlign === BI.VerticalAlign.Bottom ? (i === 0 ? o.vgap : 0) : o.vgap) + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit + "margin-bottom": (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit }); } return w; diff --git a/src/less/core/wrapper/flex.horizontal.less b/src/less/core/wrapper/flex.horizontal.less index ab5fbac8f..baec91f31 100644 --- a/src/less/core/wrapper/flex.horizontal.less +++ b/src/less/core/wrapper/flex.horizontal.less @@ -105,18 +105,21 @@ -webkit-justify-content: center; -moz-justify-content: center; -ms-justify-content: center; - -o-justify-content: center; -ms-flex-pack: center; + -o-justify-content: center; justify-content: center; } &.h-right { + /* 09版 */ + -webkit-box-pack: flex-end; /* 12版 */ - -webkit-flex-direction: row-reverse; - -moz-flex-direction: row-reverse; - -ms-flex-direction: row-reverse; - -o-flex-direction: row-reverse; - flex-direction: row-reverse; + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + -ms-flex-pack: end; + -o-justify-content: flex-end; + justify-content: flex-end; } > .shrink-none { diff --git a/src/less/core/wrapper/flex.vertical.less b/src/less/core/wrapper/flex.vertical.less index fef267687..26fc982aa 100644 --- a/src/less/core/wrapper/flex.vertical.less +++ b/src/less/core/wrapper/flex.vertical.less @@ -104,18 +104,21 @@ -webkit-justify-content: center; -moz-justify-content: center; -ms-justify-content: center; - -o-justify-content: center; -ms-flex-pack: center; + -o-justify-content: center; justify-content: center; } &.v-bottom { + /* 09版 */ + -webkit-box-pack: flex-end; /* 12版 */ - -webkit-flex-direction: column-reverse; - -moz-flex-direction: column-reverse; - -ms-flex-direction: column-reverse; - -o-flex-direction: column-reverse; - flex-direction: column-reverse; + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + -ms-flex-pack: end; + -o-justify-content: flex-end; + justify-content: flex-end; } > .shrink-none { diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 37d3df83d..80774e540 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/src/less/core/wrapper/flex.wrapper.horizontal.less @@ -118,12 +118,15 @@ } &.h-right { + /* 09版 */ + -webkit-box-pack: flex-end; /* 12版 */ - -webkit-flex-direction: row-reverse; - -moz-flex-direction: row-reverse; - -ms-flex-direction: row-reverse; - -o-flex-direction: row-reverse; - flex-direction: row-reverse; + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + -ms-flex-pack: end; + -o-justify-content: flex-end; + justify-content: flex-end; } > .shrink-none { diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index 19ad874bc..d7e8ce6e7 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/src/less/core/wrapper/flex.wrapper.vertical.less @@ -118,12 +118,15 @@ } &.v-bottom { + /* 09版 */ + -webkit-box-pack: flex-end; /* 12版 */ - -webkit-flex-direction: column-reverse; - -moz-flex-direction: column-reverse; - -ms-flex-direction: column-reverse; - -o-flex-direction: column-reverse; - flex-direction: column-reverse; + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + -ms-flex-pack: end; + -o-justify-content: flex-end; + justify-content: flex-end; } > .shrink-none {