Browse Source

DESIGN-110 feat: 反馈-tooltip

es6
zsmj 3 years ago
parent
commit
8900a40f9d
  1. 41
      src/base/single/tip/tip.tooltip.js

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

@ -7,8 +7,8 @@
*/
BI.Tooltip = BI.inherit(BI.Tip, {
_const: {
hgap: 5,
vgap: 3
hgap: 8,
vgap: 4
},
_defaultConfig: function () {
@ -39,33 +39,16 @@ BI.Tooltip = BI.inherit(BI.Tip, {
mousemove: fn
});
var texts = (o.text + "").split("\n");
if (texts.length > 1) {
BI.createWidget({
type: "bi.vertical",
element: this,
hgap: this._const.hgap,
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
});
}
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,
});
},
setWidth: function (width) {

Loading…
Cancel
Save