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
});
this.text = BI.createWidget({
type: "bi.label",
element: this,
textAlign: o.textAlign,
whiteSpace: "normal",
text: o.text,
textHeight: 20,
hgap: this._const.hgap,
vgap: this._const.vgap,
});
var texts = (o.text + "").split("\n");
if (texts.length > 1) {
BI.createWidget({
type: "bi.vertical",
element: this,
hgap: this._const.hgap,
innerVgap: this._const.vgap,
items: BI.map(texts, function (i, text) {
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) {

Loading…
Cancel
Save