guy 4 years ago
parent
commit
9b7224ca2e
  1. 22
      src/core/platform/web/config.js
  2. 4
      src/core/wrapper/layout/adapt/adapt.leftrightvertical.js
  3. 4
      src/core/wrapper/layout/flex/flex.horizontal.js
  4. 4
      src/core/wrapper/layout/flex/flex.vertical.js
  5. 4
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  6. 4
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  7. 15
      src/less/core/wrapper/flex.horizontal.less
  8. 15
      src/less/core/wrapper/flex.vertical.less
  9. 13
      src/less/core/wrapper/flex.wrapper.horizontal.less
  10. 13
      src/less/core/wrapper/flex.wrapper.vertical.less

22
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;

4
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);

4
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) {

4
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;

4
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) {

4
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;

15
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 {

15
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 {

13
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 {

13
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 {

Loading…
Cancel
Save