Skip to content

Commit

Permalink
Remove clickhandler hack for Android 4.1.1. fixes #18. Supported Andr…
Browse files Browse the repository at this point in the history
…oid now starts from 4.1.2 (Ref #31).
  • Loading branch information
Sebastien Pereira committed Sep 12, 2014
1 parent 5e9c80a commit 445440b
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions events.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ define([
}
}
}
registerClickHandler();
this._targetElement = targetElement;
};

Expand All @@ -47,7 +46,6 @@ define([
touch.deregisterHandlers(this._targetElement);
mouse.deregisterHandlers(this._targetElement);
mspointer && mspointer.deregisterHandlers(this._targetElement);
deregisterClickHandler();
}
this._targetElement = null;
};
Expand Down Expand Up @@ -153,39 +151,6 @@ define([
}
}

/**
* register click handler.
*/
function registerClickHandler() {
utils.addEventListener(window.document, "click", clickHandler, true);
}

/**
* deregister click handler
*/
function deregisterClickHandler() {
utils.removeEventListener(window.document, "click", clickHandler, true);
}

/**
* handler for Click events.
*
* @param e click event
*/
function clickHandler(e) {
if (has("touch-events")) {
// (7) Android 4.1.1 generates a click after touchend even when touchstart is prevented.
// if we receive a native click at an element with touch action disabled we just have to absorb it.
// (fixed in Android 4.1.2+)
if (utils.isNativeClickEvent(e) && (touch.determineTouchAction(e.target) !== utils.TouchAction.AUTO)) {
e.preventDefault();
e.stopImmediatePropagation();
return false;
}
}
return true;
}

// start listening to native events
pointerEvents.enable();

Expand Down

0 comments on commit 445440b

Please sign in to comment.