Skip to content

Commit c9af23e

Browse files
committed
Fixed bug for variable declaration with ES6 syntax
1 parent 43d84db commit c9af23e

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

dist/build.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/build.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-ripple-directive",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "Vue Material Ripple Effect Directive",
55
"main": "src/ripple.js",
66
"repository": {

src/ripple.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
bind: function(el, binding){
33

44
// Default values.
5-
const props = {
5+
var props = {
66
event: 'mousedown',
77
transition: 600
88
};
@@ -16,6 +16,7 @@ export default {
1616
var bg = binding.value || 'rgba(0, 0, 0, 0.35)';
1717

1818
function rippler(event, el) {
19+
console.log(event);
1920
var target = el;
2021

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

81-
if(event.type == 'mousedown') {
82+
if(event.type === 'mousedown') {
8283
el.addEventListener('mouseup', function (event) {
8384
setTimeout(function() {
8485
ripple.style.backgroundColor = "rgba(0, 0, 0, 0)";
8586
}, 250);
8687

8788
setTimeout(function() {
88-
ripple.remove();
89-
rippleContainer.remove();
89+
// ripple.remove();
90+
// rippleContainer.remove();
91+
ripple.parentNode.removeChild(ripple);
92+
rippleContainer.parentNode.removeChild(rippleContainer);
9093
}, 750);
9194
})
9295
} else {
@@ -95,8 +98,10 @@ export default {
9598
}, 250);
9699

97100
setTimeout(function() {
98-
ripple.remove();
99-
rippleContainer.remove();
101+
ripple.parentNode.removeChild(ripple);
102+
rippleContainer.parentNode.removeChild(rippleContainer);
103+
// ripple.remove();
104+
// rippleContainer.remove();
100105
}, 650);
101106
}
102107
}

0 commit comments

Comments
 (0)