Shorter module paths for default exports
This commit is contained in:
@@ -59,7 +59,7 @@ Event.prototype.preventDefault =
|
||||
|
||||
|
||||
/**
|
||||
* @param {Event|module:ol/events/Event~Event} evt Event
|
||||
* @param {Event|module:ol/events/Event} evt Event
|
||||
*/
|
||||
export function stopPropagation(evt) {
|
||||
evt.stopPropagation();
|
||||
@@ -67,7 +67,7 @@ export function stopPropagation(evt) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Event|module:ol/events/Event~Event} evt Event
|
||||
* @param {Event|module:ol/events/Event} evt Event
|
||||
*/
|
||||
export function preventDefault(evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
@@ -9,7 +9,7 @@ import Event from '../events/Event.js';
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {EventTarget|module:ol/events/EventTarget~EventTarget} EventTargetLike
|
||||
* @typedef {EventTarget|module:ol/events/EventTarget} EventTargetLike
|
||||
*/
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ import Event from '../events/Event.js';
|
||||
* returns false.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {module:ol/Disposable~Disposable}
|
||||
* @extends {module:ol/Disposable}
|
||||
*/
|
||||
const EventTarget = function() {
|
||||
|
||||
@@ -75,7 +75,7 @@ EventTarget.prototype.addEventListener = function(type, listener) {
|
||||
|
||||
/**
|
||||
* @param {{type: string,
|
||||
* target: (EventTarget|module:ol/events/EventTarget~EventTarget|undefined)}|module:ol/events/Event~Event|
|
||||
* target: (EventTarget|module:ol/events/EventTarget|undefined)}|module:ol/events/Event|
|
||||
* string} event Event or event type.
|
||||
* @return {boolean|undefined} `false` if anyone called preventDefault on the
|
||||
* event object or if any of the listeners returned false.
|
||||
|
||||
@@ -8,10 +8,10 @@ import {WEBKIT, MAC} from '../has.js';
|
||||
|
||||
|
||||
/**
|
||||
* A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
|
||||
* A function that takes an {@link module:ol/MapBrowserEvent} and returns a
|
||||
* `{boolean}`. If the condition is met, true should be returned.
|
||||
*
|
||||
* @typedef {function(module:ol/MapBrowserEvent~MapBrowserEvent): boolean} Condition
|
||||
* @typedef {function(module:ol/MapBrowserEvent): boolean} Condition
|
||||
*/
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import {WEBKIT, MAC} from '../has.js';
|
||||
* Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when
|
||||
* additionally the shift-key is pressed).
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the alt key is pressed.
|
||||
* @api
|
||||
*/
|
||||
@@ -36,7 +36,7 @@ export const 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 {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the alt and shift keys are pressed.
|
||||
* @api
|
||||
*/
|
||||
@@ -53,7 +53,7 @@ export const altShiftKeysOnly = function(mapBrowserEvent) {
|
||||
* Return `true` if the map has the focus. This condition requires a map target
|
||||
* element with a `tabindex` attribute, e.g. `<div id="map" tabindex="1">`.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} event Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} event Map browser event.
|
||||
* @return {boolean} The map has the focus.
|
||||
* @api
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ export const focus = function(event) {
|
||||
/**
|
||||
* Return always true.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True.
|
||||
* @function
|
||||
* @api
|
||||
@@ -76,7 +76,7 @@ export const always = TRUE;
|
||||
/**
|
||||
* Return `true` if the event is a `click` event, `false` otherwise.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event is a map `click` event.
|
||||
* @api
|
||||
*/
|
||||
@@ -91,7 +91,7 @@ export const click = function(mapBrowserEvent) {
|
||||
* By definition, this includes left-click on windows/linux, and left-click
|
||||
* without the ctrl key on Macs.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} The result.
|
||||
*/
|
||||
export const mouseActionButton = function(mapBrowserEvent) {
|
||||
@@ -104,7 +104,7 @@ export const mouseActionButton = function(mapBrowserEvent) {
|
||||
/**
|
||||
* Return always false.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} False.
|
||||
* @function
|
||||
* @api
|
||||
@@ -116,7 +116,7 @@ export const never = FALSE;
|
||||
* Return `true` if the browser event is a `pointermove` event, `false`
|
||||
* otherwise.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the browser event is a `pointermove` event.
|
||||
* @api
|
||||
*/
|
||||
@@ -128,7 +128,7 @@ export const pointerMove = function(mapBrowserEvent) {
|
||||
/**
|
||||
* Return `true` if the event is a map `singleclick` event, `false` otherwise.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event is a map `singleclick` event.
|
||||
* @api
|
||||
*/
|
||||
@@ -140,7 +140,7 @@ export const singleClick = function(mapBrowserEvent) {
|
||||
/**
|
||||
* Return `true` if the event is a map `dblclick` event, `false` otherwise.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event is a map `dblclick` event.
|
||||
* @api
|
||||
*/
|
||||
@@ -153,7 +153,7 @@ export const doubleClick = function(mapBrowserEvent) {
|
||||
* Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is
|
||||
* pressed.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True only if there no modifier keys are pressed.
|
||||
* @api
|
||||
*/
|
||||
@@ -171,7 +171,7 @@ export const noModifierKeys = function(mapBrowserEvent) {
|
||||
* ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally
|
||||
* the shift-key is pressed).
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the platform modifier key is pressed.
|
||||
* @api
|
||||
*/
|
||||
@@ -187,7 +187,7 @@ export const platformModifierKeyOnly = function(mapBrowserEvent) {
|
||||
* Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when
|
||||
* additionally the alt-key is pressed).
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if only the shift key is pressed.
|
||||
* @api
|
||||
*/
|
||||
@@ -204,7 +204,7 @@ export const shiftKeyOnly = function(mapBrowserEvent) {
|
||||
* Return `true` if the target element is not editable, i.e. not a `<input>`-,
|
||||
* `<select>`- or `<textarea>`-element, `false` otherwise.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True only if the target element is not editable.
|
||||
* @api
|
||||
*/
|
||||
@@ -221,14 +221,16 @@ export const targetNotEditable = function(mapBrowserEvent) {
|
||||
/**
|
||||
* Return `true` if the event originates from a mouse device.
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a mouse device.
|
||||
* @api
|
||||
*/
|
||||
export const mouseOnly = function(mapBrowserEvent) {
|
||||
assert(mapBrowserEvent.pointerEvent, 56); // mapBrowserEvent must originate from a pointer event
|
||||
// see http://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType
|
||||
return /** @type {module:ol/MapBrowserEvent~MapBrowserEvent} */ (mapBrowserEvent).pointerEvent.pointerType == 'mouse';
|
||||
return (
|
||||
/** @type {module:ol/MapBrowserEvent} */ (mapBrowserEvent).pointerEvent.pointerType == 'mouse'
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -237,7 +239,7 @@ export const mouseOnly = function(mapBrowserEvent) {
|
||||
* contact with the surface or if the left mouse button is pressed.
|
||||
* @see http://www.w3.org/TR/pointerevents/#button-states
|
||||
*
|
||||
* @param {module:ol/MapBrowserEvent~MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @param {module:ol/MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @return {boolean} True if the event originates from a primary pointer.
|
||||
* @api
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user