mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-12-01 14:03:45 +03:00
Update to fix for #18 to allow multiple ripples to be animated
This commit is contained in:
parent
225ba46ce0
commit
5ef4d92569
|
@ -35,10 +35,7 @@ var ripples = {
|
||||||
mousePos = {x: e.clientX - elPos.left, y: e.clientY - elPos.top},
|
mousePos = {x: e.clientX - elPos.left, y: e.clientY - elPos.top},
|
||||||
scale = "transform:scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")",
|
scale = "transform:scale(" + Math.round($rippleWrapper.offsetWidth / 5) + ")",
|
||||||
rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}),
|
rippleEnd = new CustomEvent("rippleEnd", {detail: $ripple}),
|
||||||
refreshElementStyle;
|
refreshElementStyle;
|
||||||
|
|
||||||
// remove old ripples
|
|
||||||
$($rippleWrapper).find(".ripple").remove();
|
|
||||||
|
|
||||||
// Set ripple class
|
// Set ripple class
|
||||||
$ripple.className = "ripple";
|
$ripple.className = "ripple";
|
||||||
|
@ -117,7 +114,7 @@ var ripples = {
|
||||||
bind("mousedown", ".ripple-wrapper, .ripple-wrapper .ripple", rippleStart);
|
bind("mousedown", ".ripple-wrapper, .ripple-wrapper .ripple", rippleStart);
|
||||||
// if animation ends and user is not holding mouse then destroy the ripple
|
// if animation ends and user is not holding mouse then destroy the ripple
|
||||||
bind("rippleEnd", ".ripple-wrapper, .ripple-wrapper .ripple", function(e, $ripple) {
|
bind("rippleEnd", ".ripple-wrapper, .ripple-wrapper .ripple", function(e, $ripple) {
|
||||||
if (!mouseDown) {
|
if (!mouseDown || !$($ripple).is(":first-child")) {
|
||||||
rippleOut($ripple);
|
rippleOut($ripple);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user