Skip to content

Commit

Permalink
Fixed bug for variable declaration with ES6 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzo committed Jul 12, 2017
1 parent 43d84db commit c9af23e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 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.8",
"version": "1.0.9",
"description": "Vue Material Ripple Effect Directive",
"main": "src/ripple.js",
"repository": {
Expand Down
17 changes: 11 additions & 6 deletions src/ripple.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {
bind: function(el, binding){

// Default values.
const props = {
var props = {
event: 'mousedown',
transition: 600
};
Expand All @@ -16,6 +16,7 @@ export default {
var bg = binding.value || 'rgba(0, 0, 0, 0.35)';

function rippler(event, el) {
console.log(event);
var target = el;

// Get necessary variables
Expand Down Expand Up @@ -78,15 +79,17 @@ export default {
ripple.style.marginTop = dy - radius + "px";
}, 0);

if(event.type == 'mousedown') {
if(event.type === 'mousedown') {
el.addEventListener('mouseup', function (event) {
setTimeout(function() {
ripple.style.backgroundColor = "rgba(0, 0, 0, 0)";
}, 250);

setTimeout(function() {
ripple.remove();
rippleContainer.remove();
// ripple.remove();
// rippleContainer.remove();
ripple.parentNode.removeChild(ripple);
rippleContainer.parentNode.removeChild(rippleContainer);
}, 750);
})
} else {
Expand All @@ -95,8 +98,10 @@ export default {
}, 250);

setTimeout(function() {
ripple.remove();
rippleContainer.remove();
ripple.parentNode.removeChild(ripple);
rippleContainer.parentNode.removeChild(rippleContainer);
// ripple.remove();
// rippleContainer.remove();
}, 650);
}
}
Expand Down

0 comments on commit c9af23e

Please sign in to comment.