@dreamworld/dw-ripple 2.4.0-development.4 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dw-ripple.js +5 -27
- package/package.json +1 -1
package/dw-ripple.js
CHANGED
|
@@ -24,7 +24,7 @@ export class DwRipple extends Ripple {
|
|
|
24
24
|
secondary: { type: Boolean, reflect: true },
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* Set to `true` to disable hover and
|
|
27
|
+
* Set to `true` to disable hover and focus in.
|
|
28
28
|
*/
|
|
29
29
|
disableHover: { type: Boolean },
|
|
30
30
|
};
|
|
@@ -49,8 +49,6 @@ export class DwRipple extends Ripple {
|
|
|
49
49
|
this.__onTouchStart = this.__onTouchStart.bind(this);
|
|
50
50
|
this.__onMouseUp = this.__onMouseUp.bind(this);
|
|
51
51
|
this.__onTouchEnd = this.__onTouchEnd.bind(this);
|
|
52
|
-
this.__onPointerMove = this.__onPointerMove.bind(this);
|
|
53
|
-
this.__onTouchMove = this.__onTouchMove.bind(this);
|
|
54
52
|
|
|
55
53
|
if (!this.disableHover) {
|
|
56
54
|
parent.addEventListener("mouseenter", this._rippleHander.startHover);
|
|
@@ -61,34 +59,16 @@ export class DwRipple extends Ripple {
|
|
|
61
59
|
|
|
62
60
|
parent.addEventListener("mousedown", this.__onMouseDown);
|
|
63
61
|
parent.addEventListener("touchstart", this.__onTouchStart);
|
|
64
|
-
window.addEventListener("pointermove", this.__onPointerMove);
|
|
65
|
-
window.addEventListener("touchmove", this.__onTouchMove);
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
__onMouseDown(e) {
|
|
69
|
-
this.
|
|
70
|
-
|
|
71
|
-
this._rippleHander.startPress(e);
|
|
72
|
-
}, 50);
|
|
65
|
+
window.addEventListener("mouseup", this.__onMouseUp);
|
|
66
|
+
this._rippleHander.startPress(e);
|
|
73
67
|
}
|
|
74
68
|
|
|
75
69
|
__onTouchStart(e) {
|
|
76
|
-
this.
|
|
77
|
-
|
|
78
|
-
this._rippleHander.startPress(e);
|
|
79
|
-
}, 50);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
__onPointerMove() {
|
|
83
|
-
if (this.delayMouseDown) {
|
|
84
|
-
clearTimeout(this.delayMouseDown);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
__onTouchMove() {
|
|
89
|
-
if (this.delayTouchStart) {
|
|
90
|
-
clearTimeout(this.delayTouchStart);
|
|
91
|
-
}
|
|
70
|
+
window.addEventListener("touchend", this.__onTouchEnd);
|
|
71
|
+
this._rippleHander.startPress(e);
|
|
92
72
|
}
|
|
93
73
|
|
|
94
74
|
__onMouseUp() {
|
|
@@ -125,8 +105,6 @@ export class DwRipple extends Ripple {
|
|
|
125
105
|
|
|
126
106
|
window.removeEventListener("touchend", this.__onTouchEnd);
|
|
127
107
|
window.removeEventListener("mouseup", this.__onMouseUp);
|
|
128
|
-
window.removeEventListener("pointermove", this.__onPointerMove);
|
|
129
|
-
window.removeEventListener("touchmove", this.__onTouchMove);
|
|
130
108
|
|
|
131
109
|
super.disconnectedCallback();
|
|
132
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamworld/dw-ripple",
|
|
3
|
-
"version": "2.4.0
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Ripple element created as child-class of [`mwc-ripple`] (https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)",
|
|
5
5
|
"main": "dw-ripple.js",
|
|
6
6
|
"scripts": {
|