From 88a3e0e41e944d6b17086c1adf2f2b4133ee3c88 Mon Sep 17 00:00:00 2001 From: hsycc Date: Thu, 28 Oct 2021 16:47:27 +0800 Subject: [PATCH] fix: fixed click events didn't take effect on safari mobile --- src/js/controller/DrawingController.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/js/controller/DrawingController.js b/src/js/controller/DrawingController.js index 0ed1f055..de172d8f 100644 --- a/src/js/controller/DrawingController.js +++ b/src/js/controller/DrawingController.js @@ -85,12 +85,12 @@ this.container.addEventListener('wheel', this.onMousewheel_.bind(this)); } - window.addEventListener('mouseup', this.onMouseup_.bind(this)); - window.addEventListener('mousemove', this.onMousemove_.bind(this)); - window.addEventListener('keyup', this.onKeyup_.bind(this)); - window.addEventListener('touchstart', this.onTouchstart_.bind(this)); - window.addEventListener('touchmove' , this.onTouchmove_.bind(this)); - window.addEventListener('touchend', this.onTouchend_.bind(this)); + this.container.addEventListener('mouseup', this.onMouseup_.bind(this)); + this.container.addEventListener('mousemove', this.onMousemove_.bind(this)); + this.container.addEventListener('keyup', this.onKeyup_.bind(this)); + this.container.addEventListener('touchstart', this.onTouchstart_.bind(this)); + this.container.addEventListener('touchmove' , this.onTouchmove_.bind(this)); + this.container.addEventListener('touchend', this.onTouchend_.bind(this)); // Deactivate right click: document.body.addEventListener('contextmenu', this.onCanvasContextMenu_.bind(this));