Browse Source

BI-74048 fix: popover宽度也做一下限制

es6
windy 4 years ago
parent
commit
5b1bf8f3be
  1. 6
      src/base/layer/layer.popover.js

6
src/base/layer/layer.popover.js

@ -140,7 +140,7 @@ BI.Popover = BI.inherit(BI.Widget, {
return BI.extend({
type: o.logic.dynamic ? "bi.vertical" : "bi.vtape",
items: items,
width: size.width,
width: this._getSuitableBodyWidth(size.width),
}, o.logic.dynamic ? {
type: "bi.vertical",
scrolly: false,
@ -166,6 +166,10 @@ BI.Popover = BI.inherit(BI.Widget, {
return BI.clamp(height, 0, BI.Widget._renderEngine.createElement("body")[0].clientHeight - o.headerHeight - (o.footer ? o.footerHeight : 0) - c.BODY_TGAP);
},
_getSuitableBodyWidth: function (width) {
return BI.clamp(width, 0, BI.Widget._renderEngine.createElement("body").width());
},
_calculateSize: function () {
var o = this.options;
var size = {};

Loading…
Cancel
Save