From 193db55dbd199d88c3d74cb117b72a2f8dabe081 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 19 Jun 2021 21:35:09 +0800 Subject: [PATCH] bugfix --- src/core/wrapper/layout/layout.inline.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index 1ee3b3dc88..e8830b9c16 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -33,7 +33,7 @@ BI.InlineLayout = BI.inherit(BI.Layout, { this.populate(o.items); }, - _addElement: function (i, item, length) { + _addElement: function (i, item) { var o = this.options; var w = BI.InlineLayout.superclass._addElement.apply(this, arguments); var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? null : item.width; @@ -50,16 +50,16 @@ BI.InlineLayout = BI.inherit(BI.Layout, { "vertical-align": o.verticalAlign }); w.element.addClass("i-item"); - if (o.columnSize[i] === "fill" || o.columnSize[i] === "") { + if (columnSize === "fill" || columnSize === "") { var left = o.hgap + (item.lgap || 0) + (item.hgap || 0), right = o.hgap + (item.rgap || 0) + (item.hgap || 0); for (var k = 0; k < i; k++) { - left += o.hgap + o.lgap + o.rgap + o.columnSize[k]; + left += o.hgap + o.lgap + o.rgap + (o.columnSize[k] || o.items[k].width); } for (var k = i + 1; k < o.columnSize.length; k++) { - right += o.hgap + o.lgap + o.rgap + o.columnSize[k]; + right += o.hgap + o.lgap + o.rgap + (o.columnSize[k] || o.items[k].width); } - if (o.columnSize[i] === "fill") { + if (columnSize === "fill") { w.element.css("min-width", "calc(100% - " + ((left + right) / BI.pixRatio + BI.pixUnit) + ")"); } if (o.horizontalAlign === BI.HorizontalAlign.Stretch || !(o.scrollable === true || o.scrollx === true)) { @@ -102,15 +102,6 @@ BI.InlineLayout = BI.inherit(BI.Layout, { throw new Error("不能添加元素"); }, - stroke: function (items) { - var self = this; - BI.each(items, function (i, item) { - if (item) { - self._addElement(i, item, items.length); - } - }); - }, - populate: function (items) { BI.InlineLayout.superclass.populate.apply(this, arguments); this._mount();