Skip to content

Commit

Permalink
Solved bug when timeout does not find container
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzo committed Jul 24, 2017
1 parent 9e06b5f commit a5b4c10
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/build.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-ripple-directive",
"version": "1.0.10",
"version": "1.0.11",
"description": "Vue Material Ripple Effect Directive",
"main": "src/ripple.js",
"repository": {
Expand Down
10 changes: 8 additions & 2 deletions src/ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,23 @@ export default {
ripple.style.backgroundColor = "rgba(0, 0, 0, 0)";
}, 250);

// Timeout set to get a smooth removal of the ripple
setTimeout(function() {
rippleContainer.parentNode.removeChild(rippleContainer);
// Conditional to avoid not finding parent when to many ripples are executed
if (rippleContainer.parentNode)
rippleContainer.parentNode.removeChild(rippleContainer);
}, 850);
})
} else {
setTimeout(function() {
ripple.style.backgroundColor = "rgba(0, 0, 0, 0)";
}, 250);

// Timeout set to get a smooth removal of the ripple
setTimeout(function() {
rippleContainer.parentNode.removeChild(rippleContainer);
// Conditional to avoid not finding parent when to many ripples are executed
if (rippleContainer.parentNode)
rippleContainer.parentNode.removeChild(rippleContainer);
}, 850);
}
}
Expand Down

0 comments on commit a5b4c10

Please sign in to comment.