提交 5d9f5a43 编写于 作者: S sushuang

Fix #6313 (treemap right click)

上级 6caf9fca
...@@ -67,12 +67,6 @@ ...@@ -67,12 +67,6 @@
* @private * @private
*/ */
this._state = 'ready'; this._state = 'ready';
/**
* @private
* @type {boolean}
*/
this._mayClick;
}, },
/** /**
...@@ -397,8 +391,6 @@ ...@@ -397,8 +391,6 @@
* @private * @private
*/ */
_onPan: function (dx, dy) { _onPan: function (dx, dy) {
this._mayClick = false;
if (this._state !== 'animating' if (this._state !== 'animating'
&& (Math.abs(dx) > DRAG_THRESHOLD || Math.abs(dy) > DRAG_THRESHOLD) && (Math.abs(dx) > DRAG_THRESHOLD || Math.abs(dy) > DRAG_THRESHOLD)
) { ) {
...@@ -431,8 +423,6 @@ ...@@ -431,8 +423,6 @@
* @private * @private
*/ */
_onZoom: function (scale, mouseX, mouseY) { _onZoom: function (scale, mouseX, mouseY) {
this._mayClick = false;
if (this._state !== 'animating') { if (this._state !== 'animating') {
// These param must not be cached. // These param must not be cached.
var root = this.seriesModel.getData().tree.root; var root = this.seriesModel.getData().tree.root;
...@@ -480,25 +470,11 @@ ...@@ -480,25 +470,11 @@
* @private * @private
*/ */
_initEvents: function (containerGroup) { _initEvents: function (containerGroup) {
// FIXME containerGroup.on('click', function (e) {
// 不用click以及silent的原因是,animate时视图设置silent true来避免click生效, if (this._state !== 'ready') {
// 但是animate中,按下鼠标,animate结束后(silent设回为false)松开鼠标, return;
// 还是会触发click,期望是不触发。
// Mousedown occurs when drag start, and mouseup occurs when drag end,
// click event should not be triggered in that case.
containerGroup.on('mousedown', function (e) {
this._state === 'ready' && (this._mayClick = true);
}, this);
containerGroup.on('mouseup', function (e) {
if (this._mayClick) {
this._mayClick = false;
this._state === 'ready' && onClick.call(this, e);
} }
}, this);
function onClick(e) {
var nodeClick = this.seriesModel.get('nodeClick', true); var nodeClick = this.seriesModel.get('nodeClick', true);
if (!nodeClick) { if (!nodeClick) {
...@@ -526,7 +502,8 @@ ...@@ -526,7 +502,8 @@
link && window.open(link, linkTarget); link && window.open(link, linkTarget);
} }
} }
}
}, this);
}, },
/** /**
......
...@@ -608,7 +608,7 @@ ...@@ -608,7 +608,7 @@
}); });
chart.on('click', function (param) { chart.on('click', function (param) {
console.log(param); alert('asdf');
}); });
// setTimeout(function () { // setTimeout(function () {
// chart.setOption({ // chart.setOption({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册