Set preventDefault in PointerEvent constructor

This commit is contained in:
tsauerwein
2014-03-13 13:45:03 +01:00
parent 68fa5fb9ce
commit 8a26ac6e24
2 changed files with 7 additions and 10 deletions

View File

@@ -384,16 +384,7 @@ ol.pointer.PointerEventHandler.prototype.contains_ =
*/
ol.pointer.PointerEventHandler.prototype.makeEvent =
function(inType, pointerEventData, browserEvent) {
var e = new ol.pointer.PointerEvent(inType, browserEvent, pointerEventData);
// keep the semantics of preventDefault
if (browserEvent.preventDefault) {
e.preventDefault = function() {
browserEvent.preventDefault();
};
}
return e;
return new ol.pointer.PointerEvent(inType, browserEvent, pointerEventData);
};