Skip to content

Commit d09279f

Browse files
author
FezVrasta
committed
1 parent efea979 commit d09279f

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

scripts/ripples.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ var ripples = {
109109
bind("mouseover", withRipple, rippleInit);
110110

111111
// start ripple effect on mousedown
112-
bind("mousedown", ".ripple-wrapper", rippleStart);
112+
bind("mousedown", ".ripple-wrapper", function(e, $ripple) {
113+
// Start ripple only on left or middle mouse click
114+
if (e.which === 1 || e.which === 2) {
115+
rippleStart(e, $ripple);
116+
}
117+
});
113118
// if animation ends and user is not holding mouse then destroy the ripple
114119
bind("rippleEnd", ".ripple-wrapper .ripple", function(e, $ripple) {
115120

template/material/scripts/ripples.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,12 @@ var ripples = {
109109
bind("mouseover", withRipple, rippleInit);
110110

111111
// start ripple effect on mousedown
112-
bind("mousedown", ".ripple-wrapper", rippleStart);
112+
bind("mousedown", ".ripple-wrapper", function(e, $ripple) {
113+
// Start ripple only on left or middle mouse click
114+
if (e.which === 1 || e.which === 2) {
115+
rippleStart(e, $ripple);
116+
}
117+
});
113118
// if animation ends and user is not holding mouse then destroy the ripple
114119
bind("rippleEnd", ".ripple-wrapper .ripple", function(e, $ripple) {
115120

0 commit comments

Comments
 (0)