From 9f0dd45d843eccc40e1095c499958b866f1382b4 Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Sat, 4 Oct 2014 08:43:25 +0200 Subject: [PATCH] fix #76 --- scripts/ripples.js | 7 ++++++- template/material/scripts/ripples.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/ripples.js b/scripts/ripples.js index 052c8295..839b2851 100644 --- a/scripts/ripples.js +++ b/scripts/ripples.js @@ -109,7 +109,12 @@ var ripples = { bind("mouseover", withRipple, rippleInit); // start ripple effect on mousedown - bind("mousedown", ".ripple-wrapper", rippleStart); + bind("mousedown", ".ripple-wrapper", function(e, $ripple) { + // Start ripple only on left or middle mouse click + if (e.which === 1 || e.which === 2) { + rippleStart(e, $ripple); + } + }); // if animation ends and user is not holding mouse then destroy the ripple bind("rippleEnd", ".ripple-wrapper .ripple", function(e, $ripple) { diff --git a/template/material/scripts/ripples.js b/template/material/scripts/ripples.js index 052c8295..839b2851 100644 --- a/template/material/scripts/ripples.js +++ b/template/material/scripts/ripples.js @@ -109,7 +109,12 @@ var ripples = { bind("mouseover", withRipple, rippleInit); // start ripple effect on mousedown - bind("mousedown", ".ripple-wrapper", rippleStart); + bind("mousedown", ".ripple-wrapper", function(e, $ripple) { + // Start ripple only on left or middle mouse click + if (e.which === 1 || e.which === 2) { + rippleStart(e, $ripple); + } + }); // if animation ends and user is not holding mouse then destroy the ripple bind("rippleEnd", ".ripple-wrapper .ripple", function(e, $ripple) {