From f845e4f9d2da3df4044fc7d6d43ce05de246ff32 Mon Sep 17 00:00:00 2001 From: sculove Date: Wed, 8 Mar 2017 16:05:10 +0900 Subject: [PATCH] fix(input): fix pointerEvent bug ref #1084 --- src/input/mouse.js | 1 + src/input/pointerevent.js | 1 + src/input/singletouch.js | 2 +- src/input/touch.js | 4 ++-- src/input/touchmouse.js | 2 +- src/inputjs/input-constructor.js | 3 --- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/input/mouse.js b/src/input/mouse.js index 5ef0ebf97..ddaf4aaaa 100644 --- a/src/input/mouse.js +++ b/src/input/mouse.js @@ -29,6 +29,7 @@ export default class MouseInput extends Input { this.evWin = MOUSE_WINDOW_EVENTS; this.pressed = false; // mousedown state + this.init(); } /** diff --git a/src/input/pointerevent.js b/src/input/pointerevent.js index 78ef8943a..6746b19f1 100644 --- a/src/input/pointerevent.js +++ b/src/input/pointerevent.js @@ -48,6 +48,7 @@ export default class PointerEventInput extends Input { this.evEl = POINTER_ELEMENT_EVENTS; this.evWin = POINTER_WINDOW_EVENTS; + this.init(); this.store = (this.manager.session.pointerEvents = []); } diff --git a/src/input/singletouch.js b/src/input/singletouch.js index bc315985d..3e841033a 100644 --- a/src/input/singletouch.js +++ b/src/input/singletouch.js @@ -32,7 +32,7 @@ export default class SingleTouchInput extends Input { this.evWin = SINGLE_TOUCH_WINDOW_EVENTS; this.started = false; - Input.apply(this, arguments); + this.init(); } handler(ev) { diff --git a/src/input/touch.js b/src/input/touch.js index b482a15e1..98c48c6ca 100644 --- a/src/input/touch.js +++ b/src/input/touch.js @@ -28,12 +28,12 @@ const TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel'; export default class TouchInput extends Input { constructor() { - TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS; - TouchInput.prototype.targetIds = {}; super(...arguments); this.evTarget = TOUCH_TARGET_EVENTS; this.targetIds = {}; + + this.init(); } handler(ev) { diff --git a/src/input/touchmouse.js b/src/input/touchmouse.js index f771d4774..932732d46 100644 --- a/src/input/touchmouse.js +++ b/src/input/touchmouse.js @@ -27,7 +27,7 @@ const DEDUP_DISTANCE = 25; export default class TouchMouseInput extends Input { constructor() { super(...arguments); - + this.init(); let handler = bindFn(this.handler, this); this.touch = new TouchInput(this.manager, handler); this.mouse = new MouseInput(this.manager, handler); diff --git a/src/inputjs/input-constructor.js b/src/inputjs/input-constructor.js index 1a1caa9b0..449161230 100644 --- a/src/inputjs/input-constructor.js +++ b/src/inputjs/input-constructor.js @@ -26,9 +26,6 @@ export default class Input { self.handler(ev); } }; - - this.init(); - } /** * @private