Fix ol.events.condition.mouseOnly parameter type

From `ol.MapBrowserEvent` to `ol.MapBrowserPointerEvent` and remove the
instanceof assert.
This commit is contained in:
Frederic Junod
2015-10-15 11:43:24 +02:00
parent 4d43fe3346
commit 552e345fbf

View File

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