Fix event type and documentation of ol.events.condition.mouseOnly

This commit is contained in:
Andreas Hocevar
2016-07-19 15:00:05 +02:00
parent c0efa21d7f
commit a9c54e0c02
4 changed files with 34 additions and 5 deletions
+4 -5
View File
@@ -199,15 +199,14 @@ 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} mapBrowserPointerEvent Map browser pointer
* event.
* @return {boolean} True if the event originates from a mouse device.
* @api stable
*/
ol.events.condition.mouseOnly = function(mapBrowserEvent) {
ol.events.condition.mouseOnly = function(mapBrowserPointerEvent) {
// 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';
return mapBrowserPointerEvent.pointerEvent.pointerType == 'mouse';
};