diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index bf5b9e0e1..e91c02675 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -37,7 +37,12 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexHorizontalLayout.superclass._addElement.apply(this, arguments); - var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? "" : item.width; + 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; + } + } w.element.css({ position: "relative" }); diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 60058d319..85c117c50 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -36,7 +36,12 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexVerticalLayout.superclass._addElement.apply(this, arguments); - var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? "" : item.height; + var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? null : item.height; + if (o.rowSize.length > 0) { + if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { + rowSize = null; + } + } w.element.css({ position: "relative" }); 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 b19bbebcd..4a23a9024 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -33,7 +33,12 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this, arguments); - var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width >= 1 ? "" : item.width; + 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; + } + } w.element.css({ position: "relative" }); 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 60cb79e31..62a38afbc 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -33,7 +33,12 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { _addElement: function (i, item) { var o = this.options; var w = BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this, arguments); - var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? "" : item.height; + var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height >= 1 ? null : item.height; + if (o.rowSize.length > 0) { + if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { + rowSize = null; + } + } w.element.css({ position: "relative" }); diff --git a/src/core/wrapper/layout/layout.tape.js b/src/core/wrapper/layout/layout.tape.js index 018cf749b..e0e103d32 100644 --- a/src/core/wrapper/layout/layout.tape.js +++ b/src/core/wrapper/layout/layout.tape.js @@ -65,6 +65,11 @@ BI.HTapeLayout = BI.inherit(BI.Layout, { BI.any(items, function (i, item) { var w = self.getWidgetByName(self._getChildName(i)); var columnSize = o.columnSize.length > 0 ? o.columnSize[i] : item.width; + if (o.columnSize.length > 0) { + if (item.width >= 1 && o.columnSize[i] >= 1 && o.columnSize[i] !== item.width) { + columnSize = item.width; + } + } if (BI.isNull(left[i])) { var preColumnSize = o.columnSize.length > 0 ? o.columnSize[i - 1] : items[i - 1].width; left[i] = left[i - 1] + preColumnSize + (items[i - 1].lgap || 0) + 2 * (items[i - 1].hgap || 0) + o.hgap + o.lgap + o.rgap; @@ -191,6 +196,11 @@ BI.VTapeLayout = BI.inherit(BI.Layout, { BI.any(items, function (i, item) { var w = self.getWidgetByName(self._getChildName(i)); var rowSize = o.rowSize.length > 0 ? o.rowSize[i] : item.height; + if (o.rowSize.length > 0) { + if (item.height >= 1 && o.rowSize[i] >= 1 && o.rowSize[i] !== item.height) { + rowSize = item.height; + } + } if (BI.isNull(top[i])) { var preRowSize = o.rowSize.length > 0 ? o.rowSize[i - 1] : items[i - 1].height; top[i] = top[i - 1] + preRowSize + (items[i - 1].tgap || 0) + 2 * (items[i - 1].vgap || 0) + o.vgap + o.tgap + o.bgap;