Skip to content

Commit

Permalink
🐛 Stop drag gesture when mouse leaves the window
Browse files Browse the repository at this point in the history
Fixes #193
  • Loading branch information
abe33 committed Jan 6, 2015
1 parent 8c066ee commit 8d026d1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/minimap-element.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,12 @@ class MinimapElement extends HTMLElement

document.body.addEventListener('mousemove', mousemoveHandler)
document.body.addEventListener('mouseup', mouseupHandler)
document.body.addEventListener('mouseout', mouseupHandler)

@dragSubscription = new Disposable =>
document.body.removeEventListener('mousemove', mousemoveHandler)
document.body.removeEventListener('mouseup', mouseupHandler)
document.body.removeEventListener('mouseout', mouseupHandler)

drag: (e, initial) ->
y = e.pageY - initial.offsetTop - initial.dragOffset
Expand Down

0 comments on commit 8d026d1

Please sign in to comment.