|
|
@ -8,7 +8,7 @@ |
|
|
|
BI.Tooltip = BI.inherit(BI.Tip, { |
|
|
|
BI.Tooltip = BI.inherit(BI.Tip, { |
|
|
|
_const: { |
|
|
|
_const: { |
|
|
|
hgap: 8, |
|
|
|
hgap: 8, |
|
|
|
vgap: 4 |
|
|
|
vgap: 4, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_defaultConfig: function () { |
|
|
|
_defaultConfig: function () { |
|
|
@ -23,12 +23,12 @@ BI.Tooltip = BI.inherit(BI.Tip, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
render: function () { |
|
|
|
var self = this, o = this.options; |
|
|
|
var o = this.options; |
|
|
|
this.element.addClass("tooltip-" + o.level); |
|
|
|
this.element.addClass("tooltip-" + o.level); |
|
|
|
var fn = function (e) { |
|
|
|
function fn(e) { |
|
|
|
o.stopPropagation && e.stopPropagation(); |
|
|
|
o.stopPropagation && e.stopPropagation(); |
|
|
|
o.stopEvent && e.stopEvent(); |
|
|
|
o.stopEvent && e.stopEvent(); |
|
|
|
}; |
|
|
|
} |
|
|
|
this.element.bind({ |
|
|
|
this.element.bind({ |
|
|
|
click: fn, |
|
|
|
click: fn, |
|
|
|
mousedown: fn, |
|
|
|
mousedown: fn, |
|
|
@ -36,7 +36,7 @@ BI.Tooltip = BI.inherit(BI.Tip, { |
|
|
|
mouseover: fn, |
|
|
|
mouseover: fn, |
|
|
|
mouseenter: fn, |
|
|
|
mouseenter: fn, |
|
|
|
mouseleave: fn, |
|
|
|
mouseleave: fn, |
|
|
|
mousemove: fn |
|
|
|
mousemove: fn, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var texts = (o.text + "").split("\n"); |
|
|
|
var texts = (o.text + "").split("\n"); |
|
|
@ -52,9 +52,9 @@ BI.Tooltip = BI.inherit(BI.Tip, { |
|
|
|
textAlign: o.textAlign, |
|
|
|
textAlign: o.textAlign, |
|
|
|
whiteSpace: "normal", |
|
|
|
whiteSpace: "normal", |
|
|
|
text: text, |
|
|
|
text: text, |
|
|
|
textHeight: 18 |
|
|
|
textHeight: 18, |
|
|
|
}; |
|
|
|
}; |
|
|
|
}) |
|
|
|
}), |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.text = BI.createWidget({ |
|
|
|
this.text = BI.createWidget({ |
|
|
@ -81,7 +81,7 @@ BI.Tooltip = BI.inherit(BI.Tip, { |
|
|
|
setLevel: function (level) { |
|
|
|
setLevel: function (level) { |
|
|
|
this.element.removeClass("tooltip-success").removeClass("tooltip-warning"); |
|
|
|
this.element.removeClass("tooltip-success").removeClass("tooltip-warning"); |
|
|
|
this.element.addClass("tooltip-" + level); |
|
|
|
this.element.addClass("tooltip-" + level); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
BI.shortcut("bi.tooltip", BI.Tooltip); |
|
|
|
BI.shortcut("bi.tooltip", BI.Tooltip); |
|
|
|