guy 3 years ago
parent
commit
4f35feb4cf
  1. 24
      src/core/wrapper/layout/layout.flow.js

24
src/core/wrapper/layout/layout.flow.js

@ -10,7 +10,7 @@
BI.FloatLeftLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-left clearfix border-sizing",
baseCls: "bi-left",
hgap: 0,
vgap: 0,
lgap: 0,
@ -22,14 +22,15 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FloatLeftLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$innerDiv = BI.Widget._renderEngine.createElement("<div>").addClass("clearfix");
if (o.hgap > 0) {
this.element.css({
this.$innerDiv.css({
"padding-left": o.hgap / 2 / BI.pixRatio + BI.pixUnit,
"padding-right": o.hgap / 2 / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap > 0) {
this.element.css({
this.$innerDiv.css({
"padding-top": o.vgap / 2 / BI.pixRatio + BI.pixUnit,
"padding-bottom": o.vgap / 2 / BI.pixRatio + BI.pixUnit
});
@ -76,6 +77,11 @@ BI.FloatLeftLayout = BI.inherit(BI.Layout, {
return w;
},
appendFragment: function (frag) {
this.$innerDiv.append(frag);
this.element.append(this.$innerDiv);
},
resize: function () {
this.stroke(this.options.items);
},
@ -99,7 +105,7 @@ BI.shortcut("bi.left", BI.FloatLeftLayout);
BI.FloatRightLayout = BI.inherit(BI.Layout, {
props: function () {
return BI.extend(BI.FloatRightLayout.superclass.props.apply(this, arguments), {
baseCls: "bi-right clearfix border-sizing",
baseCls: "bi-right",
hgap: 0,
vgap: 0,
lgap: 0,
@ -111,14 +117,15 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, {
render: function () {
BI.FloatRightLayout.superclass.render.apply(this, arguments);
var o = this.options;
this.$innerDiv = BI.Widget._renderEngine.createElement("<div>").addClass("clearfix");
if (o.hgap > 0) {
this.element.css({
this.$innerDiv.css({
"padding-left": o.hgap / 2 / BI.pixRatio + BI.pixUnit,
"padding-right": o.hgap / 2 / BI.pixRatio + BI.pixUnit
});
}
if (o.vgap > 0) {
this.element.css({
this.$innerDiv.css({
"padding-top": o.vgap / 2 / BI.pixRatio + BI.pixUnit,
"padding-bottom": o.vgap / 2 / BI.pixRatio + BI.pixUnit
});
@ -165,6 +172,11 @@ BI.FloatRightLayout = BI.inherit(BI.Layout, {
return w;
},
appendFragment: function (frag) {
this.$innerDiv.append(frag);
this.element.append(this.$innerDiv);
},
resize: function () {
this.stroke(this.options.items);
},

Loading…
Cancel
Save