Browse Source

优化布局

master
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. 47
      src/less/core/wrapper/flex.vertical.less

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

@ -107,41 +107,41 @@ BI.prepares.push(function () {
return ob;
});
BI.Plugin.configWidget("bi.flex_horizontal", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"});
}
});
BI.Plugin.configWidget("bi.flex_vertical", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"});
}
});
BI.Plugin.configWidget("bi.flex_horizontal_adapt", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"});
}
});
BI.Plugin.configWidget("bi.flex_vertical_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"});
}
});
BI.Plugin.configWidget("bi.flex_horizontal_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"});
}
});
BI.Plugin.configWidget("bi.flex_vertical_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"});
}
});
BI.Plugin.configWidget("bi.flex_center_adapt", function (ob) {
if (ob.scrollable === true || ob.scrolly === true || ob.scrollx === true) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"});
}
});
// BI.Plugin.configWidget("bi.flex_horizontal", function (ob) {
// if (ob.scrollable === true || ob.scrolly === true) {
// return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"});
// }
// });
// BI.Plugin.configWidget("bi.flex_vertical", function (ob) {
// if (ob.scrollable === true || ob.scrollx === true) {
// return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical"});
// }
// });
// BI.Plugin.configWidget("bi.flex_horizontal_adapt", function (ob) {
// if (ob.scrollable === true || ob.scrollx === true) {
// return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"});
// }
// });
// BI.Plugin.configWidget("bi.flex_vertical_adapt", function (ob) {
// if (ob.scrollable === true || ob.scrolly === true) {
// return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"});
// }
// });
// BI.Plugin.configWidget("bi.flex_horizontal_center_adapt", function (ob) {
// if (ob.scrollable === true || ob.scrollx === true) {
// return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal_adapt"});
// }
// });
// BI.Plugin.configWidget("bi.flex_vertical_center_adapt", function (ob) {
// if (ob.scrollable === true || ob.scrolly === true) {
// return BI.extend({}, ob, {type: "bi.flex_scrollable_vertical_adapt"});
// }
// });
// BI.Plugin.configWidget("bi.flex_center_adapt", function (ob) {
// if (ob.scrollable === true || ob.scrolly === true || ob.scrollx === true) {
// return BI.extend({}, ob, {type: "bi.flex_scrollable_center_adapt"});
// }
// });
BI.Plugin.configWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() <= 9) {

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

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

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

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

Loading…
Cancel
Save