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

@@ -192,6 +192,12 @@ ol.pointer.PointerEvent = function(type, browserEvent, opt_eventDict) {
*/
this.isPrimary = goog.object.get(eventDict, 'isPrimary', false);
// keep the semantics of preventDefault
if (browserEvent.preventDefault) {
this.preventDefault = function() {
browserEvent.preventDefault();
};
}
};
goog.inherits(ol.pointer.PointerEvent, goog.events.Event);