Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nits from #1486 #1494

Merged
merged 1 commit into from
May 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/standard/gestures.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// but this breaks `<input>` 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') {
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -149,7 +150,7 @@
// ignore syntethic mouse events after a touch
if (type === 'touchend') {
POINTERSTATE.touch.id = -1;
IGNORE_MOUSE(true);
ignoreMouse(true);
}
},

Expand Down Expand Up @@ -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);
}
},

Expand Down Expand Up @@ -266,7 +267,7 @@

Gestures.register({
name: 'track',
touchaction: 'none',
touchAction: 'none',
deps: ['mousedown', 'touchmove', 'touchend'],
emits: ['track'],

Expand Down