fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

8 years ago
BI.AdaptiveLayout = BI.inherit(BI.Layout, {
8 years ago
props: function () {
return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this, arguments), {
4 years ago
baseCls: "bi-adaptive",
8 years ago
hgap: null,
vgap: null,
lgap: null,
rgap: null,
tgap: null,
bgap: null
});
},
8 years ago
render: function () {
BI.AdaptiveLayout.superclass.render.apply(this, arguments);
8 years ago
this.populate(this.options.items);
},
_addElement: function (i, item) {
var o = this.options;
var w = BI.AdaptiveLayout.superclass._addElement.apply(this, arguments);
7 years ago
w.element.css({position: "relative"});
8 years ago
if (BI.isNotNull(item.left)) {
w.element.css({
left: BI.isNumber(item.left) ? this._optimiseGap(item.left) : item.left
7 years ago
});
8 years ago
}
if (BI.isNotNull(item.right)) {
w.element.css({
right: BI.isNumber(item.right) ? this._optimiseGap(item.right) : item.right
7 years ago
});
8 years ago
}
if (BI.isNotNull(item.top)) {
w.element.css({
top: BI.isNumber(item.top) ? this._optimiseGap(item.top) : item.top
7 years ago
});
8 years ago
}
if (BI.isNotNull(item.bottom)) {
w.element.css({
bottom: BI.isNumber(item.bottom) ? this._optimiseGap(item.bottom) : item.bottom
7 years ago
});
8 years ago
}
4 years ago
this._handleGap(w, item);
8 years ago
if (BI.isNotNull(item.width)) {
w.element.css({width: BI.isNumber(item.width) ? this._optimiseGap(item.width) : item.width});
8 years ago
}
if (BI.isNotNull(item.height)) {
w.element.css({height: BI.isNumber(item.height) ? this._optimiseGap(item.height) : item.height});
8 years ago
}
return w;
},
populate: function (items) {
BI.AbsoluteLayout.superclass.populate.apply(this, arguments);
8 years ago
this._mount();
8 years ago
}
});
BI.shortcut("bi.adaptive", BI.AdaptiveLayout);