From cbc0ae730ad4a3a54eee4d7008706294b6aafb58 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Thu, 23 Apr 2015 14:58:18 +0200 Subject: [PATCH] Add basic docs for events.condition.* --- src/ol/events/condition.js | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/ol/events/condition.js b/src/ol/events/condition.js index 1141a64256..de8c3d20fe 100644 --- a/src/ol/events/condition.js +++ b/src/ol/events/condition.js @@ -19,6 +19,9 @@ ol.events.ConditionType; /** + * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when + * additionally the shift-key is pressed). + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True if only the alt key is pressed. * @api stable @@ -33,6 +36,9 @@ ol.events.condition.altKeyOnly = function(mapBrowserEvent) { /** + * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise + * (e.g. when additionally the platform-modifier-key is pressed). + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True if only the alt and shift keys are pressed. * @api stable @@ -47,7 +53,8 @@ ol.events.condition.altShiftKeysOnly = function(mapBrowserEvent) { /** - * Always true. + * Return always true. + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True. * @function @@ -57,6 +64,8 @@ ol.events.condition.always = goog.functions.TRUE; /** + * Return `true` if the event is a `click` event, `false` otherwise. + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True if the event is a map `click` event. * @api stable @@ -67,7 +76,8 @@ ol.events.condition.click = function(mapBrowserEvent) { /** - * Always false. + * Return always false. + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} False. * @function @@ -77,6 +87,9 @@ ol.events.condition.never = goog.functions.FALSE; /** + * Return `true` if the browser event is a `pointermove` event, `false` + * otherwise. + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True if the browser event is a `pointermove` event. * @api @@ -87,6 +100,8 @@ ol.events.condition.pointerMove = function(mapBrowserEvent) { /** + * Return `true` if the event is a map `singleclick` event, `false` otherwise. + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True if the event is a map `singleclick` event. * @api stable @@ -97,6 +112,9 @@ ol.events.condition.singleClick = function(mapBrowserEvent) { /** + * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is + * pressed. + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True only if there no modifier keys are pressed. * @api stable @@ -111,6 +129,9 @@ ol.events.condition.noModifierKeys = function(mapBrowserEvent) { /** + * Return `true` if only the platform-modifier-key (e.g. the windows-key) is + * pressed, `false` otherwise (e.g. when additionally the shift-key is pressed). + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True if only the platform modifier key is pressed. * @api stable @@ -125,6 +146,9 @@ ol.events.condition.platformModifierKeyOnly = function(mapBrowserEvent) { /** + * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when + * additionally the alt-key is pressed). + * * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. * @return {boolean} True if only the shift key is pressed. * @api stable @@ -139,6 +163,9 @@ ol.events.condition.shiftKeyOnly = function(mapBrowserEvent) { /** + * Return `true` if the target element is not editable, i.e. not a ``-, + * `