Skip to content

Commit 68d3fd3

Browse files
author
Federico Zivolo
committed
fixed links on firefox
1 parent 218e4ae commit 68d3fd3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

scripts/ripples.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Copyright 2014+, Federico Zivolo, LICENSE at https://github.com/FezVrasta/bootstrap-material-design/blob/master/LICENSE.md */
2-
/* globals CustomEvent */
2+
/* globals CustomEvent, navigator */
33
var ripples = {
44
init : function(withRipple) {
55
"use strict";
@@ -56,6 +56,11 @@ var ripples = {
5656
$ripple.className = "ripple ripple-on";
5757
$ripple.setAttribute("style", $ripple.getAttribute("style") + ["-ms-" + scale,"-moz-" + scale,"-webkit-" + scale,scale].join(";"));
5858

59+
// Dirty fix for Firefox... seems like absolute elements inside <A> tags do not trigger the "click" event
60+
if (/firefox/i.test(navigator.userAgent)) {
61+
$el.click();
62+
}
63+
5964
// This function is called when the animation is finished
6065
setTimeout(function() {
6166

@@ -73,7 +78,6 @@ var ripples = {
7378

7479
// Let ripple fade out (with CSS)
7580
setTimeout(function() {
76-
$ripple.parentNode.parentNode.click();
7781
$ripple.remove();
7882
}, rippleOutTime);
7983
};
@@ -103,6 +107,7 @@ var ripples = {
103107
// Events handler
104108
// init RippleJS and start ripple effect on mousedown
105109
bind("mousedown", withRipple, rippleInit);
110+
106111
// start ripple effect on mousedown
107112
bind("mousedown", ".ripple-wrapper, .ripple-wrapper .ripple", rippleStart);
108113
// if animation ends and user is not holding mouse then destroy the ripple

0 commit comments

Comments
 (0)