Skip to content

Commit

Permalink
fix(input): fix pointerEvent bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sculove committed Mar 8, 2017
1 parent 17a543b commit f845e4f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/input/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class MouseInput extends Input {
this.evWin = MOUSE_WINDOW_EVENTS;

this.pressed = false; // mousedown state
this.init();
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/input/pointerevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []);
}

Expand Down
2 changes: 1 addition & 1 deletion src/input/singletouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/input/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/input/touchmouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions src/inputjs/input-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ export default class Input {
self.handler(ev);
}
};

this.init();

}
/**
* @private
Expand Down

0 comments on commit f845e4f

Please sign in to comment.