Browse Source

优化布局

es6
guy 4 years ago
parent
commit
ce55d0e9cc
  1. 70
      src/core/platform/web/config.js
  2. 47
      src/less/core/wrapper/flex.horizontal.less
  3. 49
      src/less/core/wrapper/flex.vertical.less

70
src/core/platform/web/config.js

@ -107,41 +107,41 @@ BI.prepares.push(function () {
return ob; return ob;
}); });
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.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) {
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) {
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.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) {
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.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_center_adapt", function (ob) { // BI.Plugin.configWidget("bi.flex_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true || ob.scrollx === true) { // if (ob.scrollable === true || ob.scrolly === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"}); // return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"});
} // }
}); // });
BI.Plugin.configWidget("bi.radio", function (ob) { BI.Plugin.configWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() <= 9) { if (BI.isIE() && BI.getIEVersion() <= 9) {

47
src/less/core/wrapper/flex.horizontal.less

@ -63,15 +63,19 @@
flex-wrap: nowrap; flex-wrap: nowrap;
&.v-middle { &.v-middle {
/* 09版 */ ///* 09版 */
-webkit-box-align: center; //-webkit-box-align: center;
/* 12版 */ ///* 12版 */
-webkit-align-items: center; //-webkit-align-items: center;
-moz-align-items: center; //-moz-align-items: center;
-ms-align-items: center; //-ms-align-items: center;
-ms-flex-align: center; //-ms-flex-align: center;
-o-align-items: center; //-o-align-items: center;
align-items: center; //align-items: center;
> * {
margin-top: auto !important;
margin-bottom: auto !important;
}
} }
&.v-bottom { &.v-bottom {
@ -99,15 +103,22 @@
} }
&.h-center { &.h-center {
/* 09版 */ ///* 09版 */
-webkit-box-pack: center; //-webkit-box-pack: center;
/* 12版 */ ///* 12版 */
-webkit-justify-content: center; //-webkit-justify-content: center;
-moz-justify-content: center; //-moz-justify-content: center;
-ms-justify-content: center; //-ms-justify-content: center;
-ms-flex-pack: center; //-ms-flex-pack: center;
-o-justify-content: center; //-o-justify-content: center;
justify-content: center; //justify-content: center;
> *:first-child {
margin-left: auto !important;
}
> *:last-child {
margin-right: auto !important;
}
} }
&.h-right { &.h-right {

49
src/less/core/wrapper/flex.vertical.less

@ -28,7 +28,7 @@
flex-direction: row; flex-direction: row;
} }
.bi-f-v, .bi-flex-vertical-layout{ .bi-f-v, .bi-flex-vertical-layout {
.flex(); .flex();
.vertical(); .vertical();
@ -62,15 +62,19 @@
flex-wrap: nowrap; flex-wrap: nowrap;
&.h-center { &.h-center {
/* 09版 */ ///* 09版 */
-webkit-box-align: center; //-webkit-box-align: center;
/* 12版 */ ///* 12版 */
-webkit-align-items: center; //-webkit-align-items: center;
-moz-align-items: center; //-moz-align-items: center;
-ms-align-items: center; //-ms-align-items: center;
-ms-flex-align: center; //-ms-flex-align: center;
-o-align-items: center; //-o-align-items: center;
align-items: center; //align-items: center;
> * {
margin-left: auto !important;
margin-right: auto !important;
}
} }
&.h-right { &.h-right {
@ -98,15 +102,22 @@
} }
&.v-middle { &.v-middle {
/* 09版 */ ///* 09版 */
-webkit-box-pack: center; //-webkit-box-pack: center;
/* 12版 */ ///* 12版 */
-webkit-justify-content: center; //-webkit-justify-content: center;
-moz-justify-content: center; //-moz-justify-content: center;
-ms-justify-content: center; //-ms-justify-content: center;
-ms-flex-pack: center; //-ms-flex-pack: center;
-o-justify-content: center; //-o-justify-content: center;
justify-content: center; //justify-content: center;
> *:first-child {
margin-left: auto !important;
}
> *:last-child {
margin-right: auto !important;
}
} }
&.v-bottom { &.v-bottom {

Loading…
Cancel
Save