Skip to content

Commit

Permalink
change this listener to the element
Browse files Browse the repository at this point in the history
  • Loading branch information
yofrancisco committed Jun 5, 2019
1 parent c6165f0 commit ece47f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions dist/zdog.dist.js
Expand Up @@ -711,8 +711,8 @@ Dragger.prototype.dragStart = function( event, pointer ) {
event.preventDefault();
this.dragStartX = pointer.pageX;
this.dragStartY = pointer.pageY;
window.addEventListener( moveEvent, this );
window.addEventListener( upEvent, this );
this.element.addEventListener( moveEvent, this );
this.element.addEventListener( upEvent, this );
this.onDragStart( pointer );
};

Expand All @@ -737,8 +737,8 @@ Dragger.prototype.onmouseup =
Dragger.prototype.onpointerup =
Dragger.prototype.ontouchend =
Dragger.prototype.dragEnd = function(/* event */) {
window.removeEventListener( moveEvent, this );
window.removeEventListener( upEvent, this );
this.element.removeEventListener( moveEvent, this );
this.element.removeEventListener( upEvent, this );
this.onDragEnd();
};

Expand Down

0 comments on commit ece47f1

Please sign in to comment.