Browse Source

优化布局

es6
guy 4 years ago
parent
commit
3fe7dd11d2
  1. 43
      src/core/platform/web/config.js
  2. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js
  3. 2
      src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js
  4. 54
      src/less/core/wrapper/flex.wrapper.horizontal.less
  5. 57
      src/less/core/wrapper/flex.wrapper.vertical.less

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

@ -106,42 +106,13 @@ 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.scrollx !== false) {
if (ob.hgap > 0 || ob.rgap > 0) {
return BI.extend({}, ob, {type: "bi.flex_scrollable_horizontal"});
}
}
});
BI.Plugin.configWidget("bi.radio", function (ob) {
if (BI.isIE() && BI.getIEVersion() <= 9) {

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

@ -9,7 +9,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexWrapperHorizontalLayout.superclass.props.apply(this, arguments), {
// 逆天的IE设置min-height撑不起来高度
baseCls: "bi-f-s-h clearfix" + (BI.isIE() ? " hack" : ""),
baseCls: "bi-f-s-h",
verticalAlign: BI.VerticalAlign.Top,
horizontalAlign: BI.HorizontalAlign.Left,
columnSize: [],

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

@ -9,7 +9,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FlexWrapperVerticalLayout.superclass.props.apply(this, arguments), {
// 逆天的IE设置min-height撑不起来高度
baseCls: "bi-f-s-v clearfix" + (BI.isIE() ? " hack" : ""),
baseCls: "bi-f-s-v",
horizontalAlign: BI.HorizontalAlign.Left,
verticalAlign: BI.VerticalAlign.Top,
rowSize: [],

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

@ -29,11 +29,7 @@
}
.bi-f-s-h, .bi-flex-scrollable-horizontal-layout {
&.hack {
& .f-s-h-w, & .flex-scrollable-horizontal-layout-wrapper {
height: 100%;
}
}
.flex();
& .f-s-h-w, & .flex-scrollable-horizontal-layout-wrapper {
.flex();
@ -71,19 +67,22 @@
min-height: 100%;
&.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;
> .c-e {
margin-top: auto !important;
margin-bottom: auto !important;
}
&.h-center {
min-width: 100%;
float: left;
}
}
@ -112,15 +111,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;
> .f-c {
margin-left: auto !important;
}
> .l-c {
margin-right: auto !important;
}
}
&.h-right {

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

@ -29,13 +29,7 @@
}
.bi-f-s-v, .bi-flex-scrollable-vertical-layout {
&.hack {
& .f-s-v-w, & .flex-scrollable-vertical-layout-wrapper {
&.h-center.v-middle {
height: 100%;
}
}
}
.flex();
& .f-s-v-w, & .flex-scrollable-vertical-layout-wrapper {
.flex();
@ -73,19 +67,23 @@
min-width: 100%;
&.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;
> .c-e {
margin-left: auto !important;
margin-right: auto !important;
}
&.v-middle {
min-height: 100%;
float: left;
}
}
@ -114,15 +112,22 @@
}
&.v-middle {
/* 09版 */
-webkit-box-pack: center;
/* 12版 */
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
///* 09版 */
//-webkit-box-pack: center;
///* 12版 */
//-webkit-justify-content: center;
//-moz-justify-content: center;
//-ms-justify-content: center;
//-o-justify-content: center;
//-ms-flex-pack: center;
//justify-content: center;
> .f-c {
margin-left: auto !important;
}
> .l-c {
margin-right: auto !important;
}
}
&.v-bottom {

Loading…
Cancel
Save