Browse Source

Pull request #2099: 无JIAR任务 整理代码

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '0dd8c894ebb541eea8749b1ec1a965fd9a4b812b':
  整理代码
es6
guy 3 years ago
parent
commit
3a77ba9f77
  1. 15
      src/core/wrapper/layout/float/float.absolute.horizontal.js
  2. 9
      src/core/wrapper/layout/float/float.absolute.vertical.js
  3. 12
      src/less/core/wrapper/float.absolute.less

15
src/core/wrapper/layout/float/float.absolute.horizontal.js

@ -31,26 +31,29 @@ BI.FloatAbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
},
hgap: "50%",
vgap: o.vgap,
lgap: o.lgap,
rgap: o.rgap,
tgap: o.tgap,
bgap: o.bgap
bgap: o.bgap,
// lgap和rgap不传的话内部不会设置left和right
lgap: o.lgap,
rgap: o.rgap
};
},
_formatItems: function (items) {
if (this.options.horizontalAlign !== BI.HorizontalAlign.Center) {
var o = this.options;
if (o.horizontalAlign === BI.HorizontalAlign.Left) {
return items;
}
var cls = o.horizontalAlign === BI.HorizontalAlign.Right ? "bi-abs-r-x-item" : "bi-abs-c-x-item";
return BI.map(items, function (i, item) {
if (!item || BI.isEmptyObject(item)) {
return item;
}
var el = BI.stripEL(item);
if (BI.isWidget(el)) {
el.element.addClass("bi-abs-c-x-item");
el.element.addClass(cls);
} else {
el.cls = (el.cls || "") + "bi-abs-c-x-item";
el.cls = (el.cls || "") + cls;
}
return item;
});

9
src/core/wrapper/layout/float/float.absolute.vertical.js

@ -33,24 +33,27 @@ BI.FloatAbsoluteVerticalLayout = BI.inherit(BI.Layout, {
hgap: o.hgap,
lgap: o.lgap,
rgap: o.rgap,
// tgap和bgap不传的话内部不会设置top和bottom
tgap: o.tgap,
bgap: o.bgap
};
},
_formatItems: function (items) {
if (this.options.verticalAlign !== BI.VerticalAlign.Middle) {
var o = this.options;
if (o.verticalAlign === BI.VerticalAlign.Top) {
return items;
}
var cls = o.verticalAlign === BI.VerticalAlign.Bottom ? "bi-abs-b-y-item" : "bi-abs-c-y-item";
return BI.map(items, function (i, item) {
if (!item || BI.isEmptyObject(item)) {
return item;
}
var el = BI.stripEL(item);
if (BI.isWidget(el)) {
el.element.addClass("bi-abs-c-y-item");
el.element.addClass(cls);
} else {
el.cls = (el.cls || "") + "bi-abs-c-y-item";
el.cls = (el.cls || "") + cls;
}
return item;
});

12
src/less/core/wrapper/float.absolute.less

@ -24,4 +24,14 @@
-webkit-transform: translate(-50%, -50%); /* Safari 和 Chrome */
-o-transform: translate(-50%, -50%); /* Opera */
transform: translate(-50%, -50%);
}
}
.bi-abs-b-y-item {
bottom: 0;
margin-top: auto;
}
.bi-abs-r-x-item {
right: 0;
margin-left: auto;
}

Loading…
Cancel
Save