Skip to content

Commit

Permalink
Inline DragPanHandler#_onUp
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Feb 16, 2018
1 parent e40a9c4 commit 7afc072
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/ui/handler/drag_pan.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class DragPanHandler {
util.bindAll([
'_onDown',
'_onMove',
'_onUp',
'_onTouchEnd',
'_onMouseUp',
'_onDragFrame',
Expand Down Expand Up @@ -214,21 +213,17 @@ class DragPanHandler {
}, { originalEvent: e });
}

_onUp(e: MouseEvent | TouchEvent | FocusEvent) {
this._onDragFinished(e);
}

_onMouseUp(e: MouseEvent | FocusEvent) {
if (this._ignoreEvent(e)) return;
this._onUp(e);
this._onDragFinished(e);
window.document.removeEventListener('mousemove', this._onMove);
window.document.removeEventListener('mouseup', this._onMouseUp);
window.removeEventListener('blur', this._onMouseUp);
}

_onTouchEnd(e: TouchEvent) {
if (this._ignoreEvent(e)) return;
this._onUp(e);
this._onDragFinished(e);
window.document.removeEventListener('touchmove', this._onMove);
window.document.removeEventListener('touchend', this._onTouchEnd);
}
Expand Down

0 comments on commit 7afc072

Please sign in to comment.