From b926b34be8424b6e68121f33ac99ae736aae85d7 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 26 Jul 2021 13:41:59 +0800 Subject: [PATCH 1/2] bugfix --- .../layout/float/float.absolute.horizontal.js | 7 +++-- .../float/float.absolute.leftrightvertical.js | 26 +++++++++++-------- .../layout/float/float.absolute.vertical.js | 7 +++-- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/core/wrapper/layout/float/float.absolute.horizontal.js b/src/core/wrapper/layout/float/float.absolute.horizontal.js index 994ef4b01..eb59723eb 100644 --- a/src/core/wrapper/layout/float/float.absolute.horizontal.js +++ b/src/core/wrapper/layout/float/float.absolute.horizontal.js @@ -39,12 +39,15 @@ BI.FloatAbsoluteHorizontalLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { + if (this.options.horizontalAlign !== BI.HorizontalAlign.Center) { + return items; + } return BI.map(items, function (i, item) { - if(!item || BI.isEmptyObject(item)){ + if (!item || BI.isEmptyObject(item)) { return item; } var el = BI.stripEL(item); - if(BI.isWidget(el)){ + if (BI.isWidget(el)) { el.element.addClass("bi-abs-c-x-item"); } else { el.cls = (el.cls || "") + "bi-abs-c-x-item"; diff --git a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js index 4bfbba4a0..18a0c75af 100644 --- a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js @@ -41,10 +41,12 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { var rightItems = o.items.right || []; leftItems = BI.map(leftItems, function (i, item) { var el = BI.stripEL(item); - if(BI.isWidget(el)){ - el.element.addClass("bi-abs-c-y-item"); - } else { - el.cls = (el.cls || "") + "bi-abs-c-y-item"; + if (o.verticalAlign === BI.VerticalAlign.Middle) { + if (BI.isWidget(el)) { + el.element.addClass("bi-abs-c-y-item"); + } else { + el.cls = (el.cls || "") + "bi-abs-c-y-item"; + } } var json = { el: el, @@ -66,10 +68,12 @@ BI.FloatAbsoluteLeftRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }); rightItems = BI.map(rightItems, function (i, item) { var el = BI.stripEL(item); - if(BI.isWidget(el)){ - el.element.addClass("bi-abs-c-y-item"); - } else { - el.cls = (el.cls || "") + "bi-abs-c-y-item"; + if (o.verticalAlign === BI.VerticalAlign.Middle) { + if (BI.isWidget(el)) { + el.element.addClass("bi-abs-c-y-item"); + } else { + el.cls = (el.cls || "") + "bi-abs-c-y-item"; + } } var json = { el: el, @@ -116,7 +120,7 @@ BI.FloatAbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { items: [], lgap: 0, rgap: 0, - hgap: 0, + hgap: 0 }); }, render: function () { @@ -141,11 +145,11 @@ BI.FloatAbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { _formatItems: function (items) { return BI.map(items, function (i, item) { - if(!item || BI.isEmptyObject(item)){ + if (!item || BI.isEmptyObject(item)) { return item; } var el = BI.stripEL(item); - if(BI.isWidget(el)){ + if (BI.isWidget(el)) { el.element.addClass("bi-abs-c-y-item"); } else { el.cls = (el.cls || "") + "bi-abs-c-y-item"; diff --git a/src/core/wrapper/layout/float/float.absolute.vertical.js b/src/core/wrapper/layout/float/float.absolute.vertical.js index 19f4f1f25..2cb1042bf 100644 --- a/src/core/wrapper/layout/float/float.absolute.vertical.js +++ b/src/core/wrapper/layout/float/float.absolute.vertical.js @@ -39,12 +39,15 @@ BI.FloatAbsoluteVerticalLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { + if (this.options.verticalAlign !== BI.VerticalAlign.Middle) { + return items; + } return BI.map(items, function (i, item) { - if(!item || BI.isEmptyObject(item)){ + if (!item || BI.isEmptyObject(item)) { return item; } var el = BI.stripEL(item); - if(BI.isWidget(el)){ + if (BI.isWidget(el)) { el.element.addClass("bi-abs-c-y-item"); } else { el.cls = (el.cls || "") + "bi-abs-c-y-item"; From 746adb533d06e309c135e2ae69231d3d214688e5 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 26 Jul 2021 13:43:03 +0800 Subject: [PATCH 2/2] bugfix --- .../wrapper/layout/float/float.absolute.leftrightvertical.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js index 18a0c75af..c56d101eb 100644 --- a/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js +++ b/src/core/wrapper/layout/float/float.absolute.leftrightvertical.js @@ -144,6 +144,9 @@ BI.FloatAbsoluteRightVerticalAdaptLayout = BI.inherit(BI.Layout, { }, _formatItems: function (items) { + if (this.options.verticalAlign !== BI.VerticalAlign.Middle) { + return items; + } return BI.map(items, function (i, item) { if (!item || BI.isEmptyObject(item)) { return item;