From 995f5db69d0520f6b67ed6713788e8514bcbab39 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Wed, 6 May 2015 11:30:45 -0700 Subject: [PATCH] Fix nits from #1486 --- src/standard/gestures.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/standard/gestures.html b/src/standard/gestures.html index 052a40d042..3caefbea48 100644 --- a/src/standard/gestures.html +++ b/src/standard/gestures.html @@ -28,7 +28,7 @@ // but this breaks `` focus and link clicks // disable mouse handlers for MOUSE_TIMEOUT ms after // a touchend to ignore synthetic mouse events - var MOUSE_CANCELLER = function(mouseEvent) { + var mouseCanceller = function(mouseEvent) { mouseEvent[HANDLED_OBJ] = {skip: true}; // disable "ghost clicks" if (mouseEvent.type === 'click') { @@ -43,18 +43,18 @@ } }; - function IGNORE_MOUSE(set) { + function ignoreMouse(set) { for (var i = 0, en; i < MOUSE_EVENTS.length; i++) { en = MOUSE_EVENTS[i]; if (set) { - document.addEventListener(en, MOUSE_CANCELLER, true); + document.addEventListener(en, mouseCanceller, true); } else { - document.removeEventListener(en, MOUSE_CANCELLER, true); + document.removeEventListener(en, mouseCanceller, true); } } if (set) { // disable MOUSE_CANCELLER after MOUSE_TIMEOUT ms - setTimeout(IGNORE_MOUSE, MOUSE_TIMEOUT); + setTimeout(ignoreMouse, MOUSE_TIMEOUT); } else { POINTERSTATE.mouse.target = null; } @@ -88,6 +88,7 @@ function deepTargetFind(x, y) { var node = document.elementFromPoint(x, y); + // this code path is only taken when native ShadowDOM is used var next = node.shadowRoot; while(next) { next = next.elementFromPoint(x, y); @@ -149,7 +150,7 @@ // ignore syntethic mouse events after a touch if (type === 'touchend') { POINTERSTATE.touch.id = -1; - IGNORE_MOUSE(true); + ignoreMouse(true); } }, @@ -203,8 +204,8 @@ gd[name] = (gd[name] || 0) + 1; } node.addEventListener(evType, handler); - if (recognizer.touchaction) { - this.setTouchAction(node, recognizer.touchaction); + if (recognizer.touchAction) { + this.setTouchAction(node, recognizer.touchAction); } }, @@ -266,7 +267,7 @@ Gestures.register({ name: 'track', - touchaction: 'none', + touchAction: 'none', deps: ['mousedown', 'touchmove', 'touchend'], emits: ['track'],