From 23fdfc7ce29569ee2ac7d3dbc48b7904c750a066 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 19 Aug 2021 20:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/adapt/absolute.horizontal.js | 4 ---- .../adapt/absolute.leftrightvertical.js | 4 ---- .../wrapper/layout/adapt/absolute.vertical.js | 4 ---- src/core/wrapper/layout/adapt/adapt.center.js | 4 ---- .../layout/adapt/adapt.leftrightvertical.js | 4 ---- .../wrapper/layout/adapt/adapt.vertical.js | 4 ---- .../wrapper/layout/adapt/inline.center.js | 4 ---- .../wrapper/layout/adapt/inline.horizontal.js | 4 ---- .../wrapper/layout/adapt/inline.vertical.js | 4 ---- src/core/wrapper/layout/flex/flex.center.js | 4 ---- .../layout/flex/flex.horizontal.center.js | 4 ---- .../flex/flex.leftrightvertical.center.js | 17 ++++++--------- .../layout/flex/flex.vertical.center.js | 4 ---- .../flex/wrapper/flex.wrapper.center.js | 4 ---- .../wrapper/flex.wrapper.horizontal.center.js | 4 ---- .../wrapper/flex.wrapper.vertical.center.js | 4 ---- .../layout/float/float.absolute.horizontal.js | 4 ---- .../float/float.absolute.leftrightvertical.js | 21 ++++++------------- .../layout/float/float.absolute.vertical.js | 4 ---- src/core/wrapper/layout/layout.grid.js | 1 + .../wrapper/layout/middle/middle.center.js | 4 ---- .../layout/middle/middle.float.center.js | 4 ---- .../layout/middle/middle.horizontal.js | 4 ---- .../wrapper/layout/middle/middle.vertical.js | 4 ---- 24 files changed, 13 insertions(+), 110 deletions(-) diff --git a/src/core/wrapper/layout/adapt/absolute.horizontal.js b/src/core/wrapper/layout/adapt/absolute.horizontal.js index bbae5ff4c..a8561cd0a 100644 --- a/src/core/wrapper/layout/adapt/absolute.horizontal.js +++ b/src/core/wrapper/layout/adapt/absolute.horizontal.js @@ -45,10 +45,6 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this, arguments); } diff --git a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js index 57ed23db9..0ff7ee466 100644 --- a/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/absolute.leftrightvertical.js @@ -135,10 +135,6 @@ BI.AbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { this.layout.stroke([{}].concat(this.options.items)) }, - update: function (opt) { - return this.layout.update(opt); - }, - addItem: function () { // do nothing throw new Error("不能添加子组件"); diff --git a/src/core/wrapper/layout/adapt/absolute.vertical.js b/src/core/wrapper/layout/adapt/absolute.vertical.js index a2ea783fe..58133199b 100644 --- a/src/core/wrapper/layout/adapt/absolute.vertical.js +++ b/src/core/wrapper/layout/adapt/absolute.vertical.js @@ -45,10 +45,6 @@ BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this, arguments); } diff --git a/src/core/wrapper/layout/adapt/adapt.center.js b/src/core/wrapper/layout/adapt/adapt.center.js index ba8c82f10..dc15360da 100644 --- a/src/core/wrapper/layout/adapt/adapt.center.js +++ b/src/core/wrapper/layout/adapt/adapt.center.js @@ -46,10 +46,6 @@ BI.CenterAdaptLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this, arguments); } diff --git a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js index 4e0dbeb57..6eb755ece 100644 --- a/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js +++ b/src/core/wrapper/layout/adapt/adapt.leftrightvertical.js @@ -199,10 +199,6 @@ BI.RightVerticalAdaptLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - addItem: function () { // do nothing throw new Error("不能添加子组件"); diff --git a/src/core/wrapper/layout/adapt/adapt.vertical.js b/src/core/wrapper/layout/adapt/adapt.vertical.js index 3f5f2a405..71a30d15c 100644 --- a/src/core/wrapper/layout/adapt/adapt.vertical.js +++ b/src/core/wrapper/layout/adapt/adapt.vertical.js @@ -46,10 +46,6 @@ BI.VerticalAdaptLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this, arguments); } diff --git a/src/core/wrapper/layout/adapt/inline.center.js b/src/core/wrapper/layout/adapt/inline.center.js index d8bc184db..072d86ac3 100644 --- a/src/core/wrapper/layout/adapt/inline.center.js +++ b/src/core/wrapper/layout/adapt/inline.center.js @@ -48,10 +48,6 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this.layout, arguments); } diff --git a/src/core/wrapper/layout/adapt/inline.horizontal.js b/src/core/wrapper/layout/adapt/inline.horizontal.js index 734c2bd3d..242d03f96 100644 --- a/src/core/wrapper/layout/adapt/inline.horizontal.js +++ b/src/core/wrapper/layout/adapt/inline.horizontal.js @@ -48,10 +48,6 @@ BI.InlineHorizontalAdaptLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this.layout, arguments); } diff --git a/src/core/wrapper/layout/adapt/inline.vertical.js b/src/core/wrapper/layout/adapt/inline.vertical.js index ba7bf54f5..9f888521c 100644 --- a/src/core/wrapper/layout/adapt/inline.vertical.js +++ b/src/core/wrapper/layout/adapt/inline.vertical.js @@ -48,10 +48,6 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this.layout, arguments); } diff --git a/src/core/wrapper/layout/flex/flex.center.js b/src/core/wrapper/layout/flex/flex.center.js index 0bf886ca8..9ffc0337f 100644 --- a/src/core/wrapper/layout/flex/flex.center.js +++ b/src/core/wrapper/layout/flex/flex.center.js @@ -45,10 +45,6 @@ BI.FlexCenterLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate(items); } diff --git a/src/core/wrapper/layout/flex/flex.horizontal.center.js b/src/core/wrapper/layout/flex/flex.horizontal.center.js index 8af01988c..a97188fed 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.center.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.center.js @@ -46,10 +46,6 @@ BI.FlexHorizontalCenter = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate(items); } diff --git a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js index 20e05b2ef..03915e888 100644 --- a/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js +++ b/src/core/wrapper/layout/flex/flex.leftrightvertical.center.js @@ -25,17 +25,17 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { ref: function (_ref) { self.layout = _ref; }, - items: this._formatItems(), + items: this._formatItems(o.items), scrollx: o.scrollx, scrolly: o.scrolly, scrollable: o.scrollable }; }, - _formatItems: function () { + _formatItems: function (items) { var o = this.options; - var leftItems = o.items.left || []; - var rightItems = o.items.right || []; + var leftItems = items.left || []; + var rightItems = items.right || []; leftItems = BI.map(leftItems, function (i, item) { var json = { el: BI.stripEL(item) @@ -72,11 +72,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, resize: function () { - this.layout.stroke(this._formatItems()); - }, - - update: function (opt) { - return this.layout.update(opt); + this.layout.stroke(this._formatItems(this.options.items)); }, addItem: function () { @@ -85,8 +81,7 @@ BI.FlexLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, populate: function (items) { - this.options.items = items; - this.layout.populate(this._formatItems()); + this.layout.populate(this._formatItems(items)); } }); BI.shortcut("bi.flex_left_right_vertical_adapt", BI.FlexLeftRightVerticalAdaptLayout); diff --git a/src/core/wrapper/layout/flex/flex.vertical.center.js b/src/core/wrapper/layout/flex/flex.vertical.center.js index 8b27066af..11795cd15 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.center.js +++ b/src/core/wrapper/layout/flex/flex.vertical.center.js @@ -47,10 +47,6 @@ BI.FlexVerticalCenter = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate(items); } diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js index eeb66dd20..ee44e9823 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.center.js @@ -48,10 +48,6 @@ BI.FlexWrapperCenterLayout = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate(items); } diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js index e03babc6c..1735c25ff 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.center.js @@ -48,10 +48,6 @@ BI.FlexWrapperHorizontalCenter = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate(items); } diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js index d5e7096b1..5b9e7e11d 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.center.js @@ -48,10 +48,6 @@ BI.FlexWrapperVerticalCenter = BI.inherit(BI.Layout, { this.layout.resize(); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate(items); } diff --git a/src/core/wrapper/layout/float/float.absolute.horizontal.js b/src/core/wrapper/layout/float/float.absolute.horizontal.js index d044fbe23..358535359 100644 --- a/src/core/wrapper/layout/float/float.absolute.horizontal.js +++ b/src/core/wrapper/layout/float/float.absolute.horizontal.js @@ -60,10 +60,6 @@ BI.FloatAbsoluteHorizontalLayout = BI.inherit(BI.Layout, { this.layout.stroke(this._formatItems(this.options.items)); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate(this._formatItems(items)); } diff --git a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js index e6efbdff4..06655b62d 100644 --- a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js @@ -27,7 +27,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { self.layout = _ref; }, verticalAlign: o.verticalAlign, - items: this._formatItems(), + items: this._formatItems(o.items), vgap: "50%", scrollx: o.scrollx, scrolly: o.scrolly, @@ -35,10 +35,10 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }; }, - _formatItems: function () { + _formatItems: function (items) { var o = this.options; - var leftItems = o.items.left || []; - var rightItems = o.items.right || []; + var leftItems = items.left || []; + var rightItems = items.right || []; leftItems = BI.map(leftItems, function (i, item) { var el = BI.stripEL(item); if (o.verticalAlign === BI.VerticalAlign.Middle) { @@ -97,11 +97,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, resize: function () { - this.layout.stroke(this._formatItems()); - }, - - update: function (opt) { - return this.layout.update(opt); + this.layout.stroke(this._formatItems(this.options.items)); }, addItem: function () { @@ -110,8 +106,7 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, populate: function (items) { - this.options.items = items; - this.layout.populate(this._formatItems()); + this.layout.populate(this._formatItems(items)); } }); BI.shortcut("bi.absolute_left_right_vertical_float", BI.FloatAbsoluteLeftRightVerticalAdaptLayout); @@ -169,10 +164,6 @@ BI.FloatAbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { this.layout.stroke([{}].concat(this._formatItems(this.options.items))); }, - update: function (opt) { - return this.layout.update(opt); - }, - addItem: function () { // do nothing throw new Error("不能添加子组件"); diff --git a/src/core/wrapper/layout/float/float.absolute.vertical.js b/src/core/wrapper/layout/float/float.absolute.vertical.js index b53abb144..431fa810c 100644 --- a/src/core/wrapper/layout/float/float.absolute.vertical.js +++ b/src/core/wrapper/layout/float/float.absolute.vertical.js @@ -60,10 +60,6 @@ BI.FloatAbsoluteVerticalLayout = BI.inherit(BI.Layout, { this.layout.stroke(this._formatItems(this.options.items)); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate(this._formatItems(items)); } diff --git a/src/core/wrapper/layout/layout.grid.js b/src/core/wrapper/layout/layout.grid.js index 97ad39862..dac59e74a 100644 --- a/src/core/wrapper/layout/layout.grid.js +++ b/src/core/wrapper/layout/layout.grid.js @@ -19,6 +19,7 @@ BI.GridLayout = BI.inherit(BI.Layout, { }, addItem: function () { + // do nothing throw new Error("不能添加子组件"); }, diff --git a/src/core/wrapper/layout/middle/middle.center.js b/src/core/wrapper/layout/middle/middle.center.js index d445f6a6e..a21472d72 100644 --- a/src/core/wrapper/layout/middle/middle.center.js +++ b/src/core/wrapper/layout/middle/middle.center.js @@ -65,10 +65,6 @@ BI.CenterLayout = BI.inherit(BI.Layout, { throw new Error("不能添加子组件"); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this.layout, arguments); } diff --git a/src/core/wrapper/layout/middle/middle.float.center.js b/src/core/wrapper/layout/middle/middle.float.center.js index 6754528f7..b5edb61fc 100644 --- a/src/core/wrapper/layout/middle/middle.float.center.js +++ b/src/core/wrapper/layout/middle/middle.float.center.js @@ -64,10 +64,6 @@ BI.FloatCenterLayout = BI.inherit(BI.Layout, { throw new Error("不能添加子组件"); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this.layout, arguments); } diff --git a/src/core/wrapper/layout/middle/middle.horizontal.js b/src/core/wrapper/layout/middle/middle.horizontal.js index 2876d3542..f54f32996 100644 --- a/src/core/wrapper/layout/middle/middle.horizontal.js +++ b/src/core/wrapper/layout/middle/middle.horizontal.js @@ -63,10 +63,6 @@ BI.HorizontalCenterLayout = BI.inherit(BI.Layout, { throw new Error("不能添加子组件"); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this.layout, arguments); } diff --git a/src/core/wrapper/layout/middle/middle.vertical.js b/src/core/wrapper/layout/middle/middle.vertical.js index c8c6b6d36..bedb60a22 100644 --- a/src/core/wrapper/layout/middle/middle.vertical.js +++ b/src/core/wrapper/layout/middle/middle.vertical.js @@ -64,10 +64,6 @@ BI.VerticalCenterLayout = BI.inherit(BI.Layout, { throw new Error("不能添加子组件"); }, - update: function (opt) { - return this.layout.update(opt); - }, - populate: function (items) { this.layout.populate.apply(this.layout, arguments); }