Skip to content

Commit 213222c

Browse files
committed
Merge branch 'dev'
2 parents 6c798ba + c43e419 commit 213222c

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

Diff for: dist/build.js

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

Diff for: dist/build.js.map

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

Diff for: 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.6",
3+
"version": "1.0.7",
44
"description": "Vue Material Ripple Effect Directive",
55
"main": "src/ripple.js",
66
"repository": {

Diff for: src/ripple.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default {
2-
name: 'ripple',
3-
bind (el, binding) {
2+
bind: function(el, binding){
43

54
// Default values.
65
const props = {
@@ -10,17 +9,17 @@ export default {
109

1110
setProps(Object.keys(binding.modifiers),props);
1211

13-
el.addEventListener(props.event, (event) => {
12+
el.addEventListener(props.event, function(event) {
1413
rippler(event, el, binding.value);
1514
});
1615

17-
let bg = binding.value || 'rgba(0, 0, 0, 0.35)';
16+
var bg = binding.value || 'rgba(0, 0, 0, 0.35)';
1817

1918
function rippler(event, el) {
20-
let target = el;
19+
var target = el;
2120

2221
// Get necessary variables
23-
let rect = target.getBoundingClientRect(),
22+
var rect = target.getBoundingClientRect(),
2423
left = rect.left,
2524
top = rect.top,
2625
width = target.offsetWidth,
@@ -33,21 +32,21 @@ export default {
3332
radius = Math.sqrt((maxX * maxX) + (maxY * maxY));
3433

3534
// Create the ripple and its container
36-
let ripple = document.createElement("div"),
35+
var ripple = document.createElement("div"),
3736
rippleContainer = document.createElement("div");
3837

3938
//Styles for ripple
4039
ripple.style.marginTop= '0px';
4140
ripple.style.marginLeft= '0px';
4241
ripple.style.width= '1px';
4342
ripple.style.height= '1px';
44-
ripple.style.transition= `all ${props.transition}ms cubic-bezier(0.4, 0, 0.2, 1)`;
43+
ripple.style.transition= 'all ' + props.transition + 'ms cubic-bezier(0.4, 0, 0.2, 1)';
4544
ripple.style.borderRadius= '50%';
4645
ripple.style.pointerEvents= 'none';
4746
ripple.style.position= 'relative';
4847
ripple.style.zIndex= '9999';
4948
ripple.style.backgroundColor = bg;
50-
49+
5150
//Styles for rippleContainer
5251
rippleContainer.style.position= 'absolute';
5352
rippleContainer.style.left = '0';
@@ -56,7 +55,7 @@ export default {
5655
rippleContainer.style.width = '0';
5756
rippleContainer.style.pointerEvents = 'none';
5857
rippleContainer.style.overflow = 'hidden';
59-
58+
6059
rippleContainer.appendChild(ripple);
6160
document.body.appendChild(rippleContainer);
6261

@@ -93,7 +92,7 @@ export default {
9392
}
9493

9594
function setProps(modifiers,props) {
96-
modifiers.forEach((item) => {
95+
modifiers.forEach(function(item) {
9796
if(isNaN(Number(item)))
9897
props.event = item;
9998
else

0 commit comments

Comments
 (0)