|
28 | 28 | // but this breaks `<input>` focus and link clicks
|
29 | 29 | // disable mouse handlers for MOUSE_TIMEOUT ms after
|
30 | 30 | // a touchend to ignore synthetic mouse events
|
31 |
| - var MOUSE_CANCELLER = function(mouseEvent) { |
| 31 | + var mouseCanceller = function(mouseEvent) { |
32 | 32 | mouseEvent[HANDLED_OBJ] = {skip: true};
|
33 | 33 | // disable "ghost clicks"
|
34 | 34 | if (mouseEvent.type === 'click') {
|
|
43 | 43 | }
|
44 | 44 | };
|
45 | 45 |
|
46 |
| - function IGNORE_MOUSE(set) { |
| 46 | + function ignoreMouse(set) { |
47 | 47 | for (var i = 0, en; i < MOUSE_EVENTS.length; i++) {
|
48 | 48 | en = MOUSE_EVENTS[i];
|
49 | 49 | if (set) {
|
50 |
| - document.addEventListener(en, MOUSE_CANCELLER, true); |
| 50 | + document.addEventListener(en, mouseCanceller, true); |
51 | 51 | } else {
|
52 |
| - document.removeEventListener(en, MOUSE_CANCELLER, true); |
| 52 | + document.removeEventListener(en, mouseCanceller, true); |
53 | 53 | }
|
54 | 54 | }
|
55 | 55 | if (set) {
|
56 | 56 | // disable MOUSE_CANCELLER after MOUSE_TIMEOUT ms
|
57 |
| - setTimeout(IGNORE_MOUSE, MOUSE_TIMEOUT); |
| 57 | + setTimeout(ignoreMouse, MOUSE_TIMEOUT); |
58 | 58 | } else {
|
59 | 59 | POINTERSTATE.mouse.target = null;
|
60 | 60 | }
|
|
88 | 88 |
|
89 | 89 | function deepTargetFind(x, y) {
|
90 | 90 | var node = document.elementFromPoint(x, y);
|
| 91 | + // this code path is only taken when native ShadowDOM is used |
91 | 92 | var next = node.shadowRoot;
|
92 | 93 | while(next) {
|
93 | 94 | next = next.elementFromPoint(x, y);
|
|
149 | 150 | // ignore syntethic mouse events after a touch
|
150 | 151 | if (type === 'touchend') {
|
151 | 152 | POINTERSTATE.touch.id = -1;
|
152 |
| - IGNORE_MOUSE(true); |
| 153 | + ignoreMouse(true); |
153 | 154 | }
|
154 | 155 | },
|
155 | 156 |
|
|
203 | 204 | gd[name] = (gd[name] || 0) + 1;
|
204 | 205 | }
|
205 | 206 | node.addEventListener(evType, handler);
|
206 |
| - if (recognizer.touchaction) { |
207 |
| - this.setTouchAction(node, recognizer.touchaction); |
| 207 | + if (recognizer.touchAction) { |
| 208 | + this.setTouchAction(node, recognizer.touchAction); |
208 | 209 | }
|
209 | 210 | },
|
210 | 211 |
|
|
266 | 267 |
|
267 | 268 | Gestures.register({
|
268 | 269 | name: 'track',
|
269 |
| - touchaction: 'none', |
| 270 | + touchAction: 'none', |
270 | 271 | deps: ['mousedown', 'touchmove', 'touchend'],
|
271 | 272 | emits: ['track'],
|
272 | 273 |
|
|
0 commit comments