Browse Source

Pull request #1982: 无JIRA任务 bugfix

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

* commit '2e1ef22a84be85dd44f3490bbd30f8b4221a0eca':
  add
master
guy 3 years ago
parent
commit
2a0a61199e
  1. 43
      src/core/wrapper/layout/adapt/absolute.horizontal.js
  2. 45
      src/core/wrapper/layout/adapt/absolute.vertical.js

43
src/core/wrapper/layout/adapt/absolute.horizontal.js

@ -7,6 +7,8 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-abs-h-a", baseCls: "bi-abs-h-a",
horizontalAlign: BI.HorizontalAlign.Center,
rowSize: [],
hgap: 0, hgap: 0,
lgap: 0, lgap: 0,
rgap: 0, rgap: 0,
@ -17,26 +19,26 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.AbsoluteHorizontalLayout.superclass.render.apply(this, arguments); BI.AbsoluteHorizontalLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
}, type: "bi.vtape",
horizontalAlign: o.horizontalAlign,
_addElement: function (i, item) { rowSize: o.rowSize,
var o = this.options; items: o.items,
var w = BI.AbsoluteHorizontalLayout.superclass._addElement.apply(this, arguments); scrollx: o.scrollx,
w.element.css({ scrolly: o.scrolly,
position: "absolute", scrollable: o.scrollable,
left: (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit, ref: function (_ref) {
right: (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit, self.layout = _ref;
margin: "auto" },
}); hgap: o.hgap,
if (o.vgap + o.tgap + (item.vgap || 0) + (item.tgap || 0) !== 0) { vgap: o.vgap,
w.element.css("top", (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit); lgap: o.lgap,
} rgap: o.rgap,
if (o.vgap + o.bgap + (item.vgap || 0) + (item.bgap || 0) !== 0) { tgap: o.tgap,
w.element.css("bottom", (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit); bgap: o.bgap
} };
return w;
}, },
resize: function () { resize: function () {
@ -44,8 +46,7 @@ BI.AbsoluteHorizontalLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.AbsoluteHorizontalLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.absolute_horizontal_adapt", BI.AbsoluteHorizontalLayout); BI.shortcut("bi.absolute_horizontal_adapt", BI.AbsoluteHorizontalLayout);

45
src/core/wrapper/layout/adapt/absolute.vertical.js

@ -7,6 +7,8 @@ BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
props: function () { props: function () {
return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this, arguments), { return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-abs-v-a", baseCls: "bi-abs-v-a",
verticalAlign: BI.VerticalAlign.Middle,
columnSize: [],
hgap: 0, hgap: 0,
lgap: 0, lgap: 0,
rgap: 0, rgap: 0,
@ -17,28 +19,26 @@ BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
}, },
render: function () { render: function () {
var self = this, o = this.options;
BI.AbsoluteVerticalLayout.superclass.render.apply(this, arguments); BI.AbsoluteVerticalLayout.superclass.render.apply(this, arguments);
this.populate(this.options.items); return {
}, type: "bi.htape",
verticalAlign: o.verticalAlign,
_addElement: function (i, item) { columnSize: o.columnSize,
var o = this.options; items: o.items,
var w = BI.AbsoluteVerticalLayout.superclass._addElement.apply(this, arguments); scrollx: o.scrollx,
w.element.css({ scrolly: o.scrolly,
position: "absolute", scrollable: o.scrollable,
left: item.lgap / BI.pixRatio + BI.pixUnit, ref: function (_ref) {
right: item.rgap / BI.pixRatio + BI.pixUnit, self.layout = _ref;
top: (o.vgap + o.tgap + (item.tgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit, },
bottom: (o.vgap + o.bgap + (item.bgap || 0) + (item.vgap || 0)) / BI.pixRatio + BI.pixUnit, hgap: o.hgap,
margin: "auto" vgap: o.vgap,
}); lgap: o.lgap,
if (o.hgap + o.lgap + (item.hgap || 0) + (item.lgap || 0) !== 0) { rgap: o.rgap,
w.element.css("left", (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit); tgap: o.tgap,
} bgap: o.bgap
if (o.hgap + o.rgap + (item.hgap || 0) + (item.rgap || 0) !== 0) { };
w.element.css("right", (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0)) / BI.pixRatio + BI.pixUnit);
}
return w;
}, },
resize: function () { resize: function () {
@ -46,8 +46,7 @@ BI.AbsoluteVerticalLayout = BI.inherit(BI.Layout, {
}, },
populate: function (items) { populate: function (items) {
BI.AbsoluteVerticalLayout.superclass.populate.apply(this, arguments); this.layout.populate.apply(this, arguments);
this._mount();
} }
}); });
BI.shortcut("bi.absolute_vertical_adapt", BI.AbsoluteVerticalLayout); BI.shortcut("bi.absolute_vertical_adapt", BI.AbsoluteVerticalLayout);

Loading…
Cancel
Save