Skip to content

Commit

Permalink
https://github.com/PygmySlowLoris/vue-ripple-directive/issues/21
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoud Aldaas committed Jun 13, 2018
1 parent 06b2efc commit 4c63643
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ var Ripple = {
}, 850);

el.removeEventListener('mouseup', clearRipple, false);
el.removeEventListener('mouseleave', clearRipple, false);
el.removeEventListener('dragstart', clearRipple, false);

// After removing event set position to target to it's original one
// Timeout it's needed to avoid jerky effect of ripple jumping out parent target
Expand All @@ -130,6 +132,8 @@ var Ripple = {

if(event.type === 'mousedown') {
el.addEventListener('mouseup', clearRipple, false);
el.addEventListener('mouseleave', clearRipple, false);
el.addEventListener('dragstart', clearRipple, false);
} else {
clearRipple();
}
Expand Down

0 comments on commit 4c63643

Please sign in to comment.