Browse Source

DESIGN-110 feat: 反馈-tooltip

es6
zsmj 2 years ago
parent
commit
5aa68fdbf0
  1. 39
      src/base/single/tip/tip.tooltip.js

39
src/base/single/tip/tip.tooltip.js

@ -39,16 +39,35 @@ BI.Tooltip = BI.inherit(BI.Tip, {
mousemove: fn mousemove: fn
}); });
this.text = BI.createWidget({ var texts = (o.text + "").split("\n");
type: "bi.label", if (texts.length > 1) {
element: this, BI.createWidget({
textAlign: o.textAlign, type: "bi.vertical",
whiteSpace: "normal", element: this,
text: o.text, hgap: this._const.hgap,
textHeight: 20, innerVgap: this._const.vgap,
hgap: this._const.hgap, items: BI.map(texts, function (i, text) {
vgap: this._const.vgap, return {
}); type: "bi.label",
textAlign: o.textAlign,
whiteSpace: "normal",
text: text,
textHeight: 18
};
})
});
} else {
this.text = BI.createWidget({
type: "bi.label",
element: this,
textAlign: o.textAlign,
whiteSpace: "normal",
text: o.text,
textHeight: 18,
hgap: this._const.hgap,
vgap: this._const.vgap,
});
}
}, },
setWidth: function (width) { setWidth: function (width) {

Loading…
Cancel
Save