Merge pull request #5453 from ahocevar/mapbrowserpointerevent

Reference ol.MapBrowserEvent instead of ol.MapBrowserPointerEvent
This commit is contained in:
Andreas Hocevar
2016-06-13 14:01:49 +02:00
committed by GitHub
4 changed files with 12 additions and 6 deletions

View File

@@ -202,12 +202,14 @@ ol.events.condition.targetNotEditable = function(mapBrowserEvent) {
/**
* Return `true` if the event originates from a mouse device.
*
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Map browser event.
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event originates from a mouse device.
* @api stable
*/
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
goog.asserts.assertInstanceof(mapBrowserEvent, ol.MapBrowserPointerEvent,
'Requires an ol.MapBrowserPointerEvent to work.');
return mapBrowserEvent.pointerEvent.pointerType == 'mouse';
};

View File

@@ -73,11 +73,11 @@ ol.interaction.ModifyEvent = function(type, features, mapBrowserPointerEvent) {
this.features = features;
/**
* Associated {@link ol.MapBrowserPointerEvent}.
* @type {ol.MapBrowserPointerEvent}
* Associated {@link ol.MapBrowserEvent}.
* @type {ol.MapBrowserEvent}
* @api
*/
this.mapBrowserPointerEvent = mapBrowserPointerEvent;
this.mapBrowserEvent = mapBrowserPointerEvent;
};
ol.inherits(ol.interaction.ModifyEvent, ol.events.Event);