diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index d86a2523e..d37f5d765 100644 --- a/src/core/platform/web/config.js +++ b/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) { diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js index 08d9c9835..39bfc329f 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/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: [], diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js index 92bc16154..69e7b6103 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/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: [], diff --git a/src/less/core/wrapper/flex.wrapper.horizontal.less b/src/less/core/wrapper/flex.wrapper.horizontal.less index 0fccf4346..0d81f46f8 100644 --- a/src/less/core/wrapper/flex.wrapper.horizontal.less +++ b/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 { diff --git a/src/less/core/wrapper/flex.wrapper.vertical.less b/src/less/core/wrapper/flex.wrapper.vertical.less index d9071cb8a..a01580a8d 100644 --- a/src/less/core/wrapper/flex.wrapper.vertical.less +++ b/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 {