Browse Source

优化布局

master
guy 4 years ago
parent
commit
d0ce902274
  1. 7
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  2. 7
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js

7
src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js

@ -49,6 +49,13 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
if (o.columnSize[i] === "fill") {
w.element.addClass("f-f");
}
w.element.addClass("c-e");
if (i === 0) {
w.element.addClass("f-c");
}
if (i === o.items.length - 1) {
w.element.addClass("l-c");
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit

7
src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js

@ -49,6 +49,13 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
if (o.rowSize[i] === "fill") {
w.element.addClass("f-f");
}
w.element.addClass("c-e");
if (i === 0) {
w.element.addClass("f-c");
}
if (i === o.items.length - 1) {
w.element.addClass("l-c");
}
if (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0) !== 0) {
w.element.css({
"margin-top": ((i === 0 ? o.vgap : 0) + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit

Loading…
Cancel
Save