From 1d585de8a87d5bd0cb5d051871c5b607e8ff7292 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 17 Feb 2022 16:45:59 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=B8=83=E5=B1=80=E6=94=AF=E6=8C=81?= =?UTF-8?q?padding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 92a836ddf..4c94198ff 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -55,6 +55,20 @@ BI.Layout = BI.inherit(BI.Widget, { if (this.options.right) { this.element.css("right", BI.isNumber(this.options.right) ? this.options.right / BI.pixRatio + BI.pixUnit : this.options.right); } + if (this.options.padding) { + if (this.options.padding.left) { + this.element.css("padding-left", BI.isNumber(this.options.padding.left) ? this.options.padding.left / BI.pixRatio + BI.pixUnit : this.options.padding.left); + } + if (this.options.padding.right) { + this.element.css("padding-right", BI.isNumber(this.options.padding.right) ? this.options.padding.right / BI.pixRatio + BI.pixUnit : this.options.padding.right); + } + if (this.options.padding.top) { + this.element.css("padding-top", BI.isNumber(this.options.padding.top) ? this.options.padding.top / BI.pixRatio + BI.pixUnit : this.options.padding.top); + } + if (this.options.padding.bottom) { + this.element.css("padding-bottom", BI.isNumber(this.options.padding.bottom) ? this.options.padding.bottom / BI.pixRatio + BI.pixUnit : this.options.padding.bottom); + } + } }, _init4Scroll: function () { @@ -272,8 +286,8 @@ BI.Layout = BI.inherit(BI.Widget, { "margin-top": "", "margin-bottom": "", "margin-left": "", - "margin-right": "", - }) + "margin-right": "" + }); }, _optimiseGap: function (gap) {