From 24bfbe145ae656617bb137d879f62af70b61bebe Mon Sep 17 00:00:00 2001 From: git Date: Wed, 23 Jun 2021 00:39:23 +0800 Subject: [PATCH] add --- src/core/platform/web/config.js | 7 +-- .../wrapper/layout/adapt/adapt.horizontal.js | 50 +------------------ src/core/wrapper/layout/adapt/adapt.table.js | 1 - 3 files changed, 6 insertions(+), 52 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index 7ae257f026..7dc2471d8e 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -28,7 +28,7 @@ BI.prepares.push(function () { }, ob, {type: "bi.inline"}); }); BI.Plugin.configWidget("bi.center_adapt", function (ob) { - var supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); + var supportFlex = isSupportFlex(); // var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; // if (!isAdapt || justOneItem) { if (supportFlex) { @@ -39,7 +39,7 @@ BI.prepares.push(function () { // return ob; }); BI.Plugin.configWidget("bi.vertical_adapt", function (ob) { - var supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); + var supportFlex = isSupportFlex(); // var isAdapt = ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; // if (!isAdapt || justOneItem) { if (supportFlex) { @@ -66,7 +66,8 @@ BI.prepares.push(function () { } if (supportFlex) { return BI.extend({ - horizontalAlign: BI.HorizontalAlign.Center + horizontalAlign: BI.HorizontalAlign.Center, + scrollx: false }, ob, {type: "bi.flex_horizontal"}); } return BI.extend({ diff --git a/src/core/wrapper/layout/adapt/adapt.horizontal.js b/src/core/wrapper/layout/adapt/adapt.horizontal.js index 8795a3cd4a..4d6fbae2af 100644 --- a/src/core/wrapper/layout/adapt/adapt.horizontal.js +++ b/src/core/wrapper/layout/adapt/adapt.horizontal.js @@ -3,52 +3,6 @@ * @class BI.HorizontalAdaptLayout * @extends BI.Layout */ -BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, { - props: function () { - return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), { - baseCls: "bi-h-a", - verticalAlign: BI.VerticalAlign.Top, - horizontalAlign: BI.HorizontalAlign.Center, - columnSize: [], - scrollx: false, - hgap: 0, - vgap: 0, - lgap: 0, - rgap: 0, - tgap: 0, - bgap: 0 - }); - }, - render: function () { - var self = this, o = this.options; - BI.HorizontalAdaptLayout.superclass.render.apply(this, arguments); - return { - type: "bi.horizontal", - verticalAlign: o.verticalAlign, - horizontalAlign: o.horizontalAlign, - columnSize: o.columnSize, - items: o.items, - scrollx: o.scrollx, - scrolly: o.scrolly, - scrollable: o.scrollable, - ref: function (_ref) { - self.layout = _ref; - }, - hgap: o.hgap, - vgap: o.vgap, - lgap: o.lgap, - rgap: o.rgap, - tgap: o.tgap, - bgap: o.bgap - }; - }, - - resize: function () { - // console.log("horizontal_adapt布局不需要resize"); - }, - - populate: function (items) { - this.layout.populate.apply(this, arguments); - } -}); +BI.HorizontalAdaptLayout = function () { +}; BI.shortcut("bi.horizontal_adapt", BI.HorizontalAdaptLayout); diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index 1552036242..0a2f3aaf27 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -10,7 +10,6 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { columnSize: [], verticalAlign: BI.VerticalAlign.Top, horizontalAlign: BI.HorizontalAlign.Left, - scrollx: true, hgap: 0, vgap: 0, lgap: 0,