Skip to content

Commit 995f5db

Browse files
committed
Fix nits from #1486
1 parent c8cde9b commit 995f5db

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/standard/gestures.html

+10-9
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
// but this breaks `<input>` focus and link clicks
2929
// disable mouse handlers for MOUSE_TIMEOUT ms after
3030
// a touchend to ignore synthetic mouse events
31-
var MOUSE_CANCELLER = function(mouseEvent) {
31+
var mouseCanceller = function(mouseEvent) {
3232
mouseEvent[HANDLED_OBJ] = {skip: true};
3333
// disable "ghost clicks"
3434
if (mouseEvent.type === 'click') {
@@ -43,18 +43,18 @@
4343
}
4444
};
4545

46-
function IGNORE_MOUSE(set) {
46+
function ignoreMouse(set) {
4747
for (var i = 0, en; i < MOUSE_EVENTS.length; i++) {
4848
en = MOUSE_EVENTS[i];
4949
if (set) {
50-
document.addEventListener(en, MOUSE_CANCELLER, true);
50+
document.addEventListener(en, mouseCanceller, true);
5151
} else {
52-
document.removeEventListener(en, MOUSE_CANCELLER, true);
52+
document.removeEventListener(en, mouseCanceller, true);
5353
}
5454
}
5555
if (set) {
5656
// disable MOUSE_CANCELLER after MOUSE_TIMEOUT ms
57-
setTimeout(IGNORE_MOUSE, MOUSE_TIMEOUT);
57+
setTimeout(ignoreMouse, MOUSE_TIMEOUT);
5858
} else {
5959
POINTERSTATE.mouse.target = null;
6060
}
@@ -88,6 +88,7 @@
8888

8989
function deepTargetFind(x, y) {
9090
var node = document.elementFromPoint(x, y);
91+
// this code path is only taken when native ShadowDOM is used
9192
var next = node.shadowRoot;
9293
while(next) {
9394
next = next.elementFromPoint(x, y);
@@ -149,7 +150,7 @@
149150
// ignore syntethic mouse events after a touch
150151
if (type === 'touchend') {
151152
POINTERSTATE.touch.id = -1;
152-
IGNORE_MOUSE(true);
153+
ignoreMouse(true);
153154
}
154155
},
155156

@@ -203,8 +204,8 @@
203204
gd[name] = (gd[name] || 0) + 1;
204205
}
205206
node.addEventListener(evType, handler);
206-
if (recognizer.touchaction) {
207-
this.setTouchAction(node, recognizer.touchaction);
207+
if (recognizer.touchAction) {
208+
this.setTouchAction(node, recognizer.touchAction);
208209
}
209210
},
210211

@@ -266,7 +267,7 @@
266267

267268
Gestures.register({
268269
name: 'track',
269-
touchaction: 'none',
270+
touchAction: 'none',
270271
deps: ['mousedown', 'touchmove', 'touchend'],
271272
emits: ['track'],
272273

0 commit comments

Comments
 (0)