From 2a70131ccd989c666bbe39bb3dac2afef49eb67c Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 19 Jun 2021 19:15:20 +0800 Subject: [PATCH] update --- src/core/wrapper/layout/layout.inline.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/wrapper/layout/layout.inline.js b/src/core/wrapper/layout/layout.inline.js index ea0384782..1ee3b3dc8 100644 --- a/src/core/wrapper/layout/layout.inline.js +++ b/src/core/wrapper/layout/layout.inline.js @@ -36,8 +36,16 @@ BI.InlineLayout = BI.inherit(BI.Layout, { _addElement: function (i, item, length) { 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; + if (o.columnSize.length > 0) { + if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { + columnSize = null; + } + } + if (columnSize > 0) { + w.element.width(columnSize < 1 ? ((columnSize * 100).toFixed(1) + "%") : (columnSize / BI.pixRatio + BI.pixUnit)); + } w.element.css({ - width: o.columnSize[i] === "" ? "" : (o.columnSize[i] < 1 ? ((o.columnSize[i] * 100).toFixed(1) + "%") : (o.columnSize[i] / BI.pixRatio + BI.pixUnit)), position: "relative", "vertical-align": o.verticalAlign });