提交 c1eb7975 编写于 作者: 1 100pah

[tooltip] support triggerOn 'none', which enable user to control tooltip totally using API.

上级 282c20f5
......@@ -17,7 +17,7 @@ define(function (require) {
// 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis'
trigger: 'item',
// 触发条件,支持 'click' | 'mousemove'
// 触发条件,支持 'click' | 'mousemove' | 'none'
triggerOn: 'mousemove',
// 是否永远显示 content
......
......@@ -256,14 +256,17 @@ define(function (require) {
zr.off('mousemove', this._mousemove);
zr.off('mouseout', this._hide);
zr.off('globalout', this._hide);
if (tooltipModel.get('triggerOn') === 'click') {
var triggerOn = tooltipModel.get('triggerOn');
if (triggerOn === 'click') {
zr.on('click', this._tryShow, this);
}
else {
else if (triggerOn === 'mousemove') {
zr.on('mousemove', this._mousemove, this);
zr.on('mouseout', this._hide, this);
zr.on('globalout', this._hide, this);
}
// else triggerOn is 'none', which enable user
// to control tooltip totally using API.
},
_mousemove: function (e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册