Named exports from ol/events/Event
This commit is contained in:
@@ -18,7 +18,7 @@ import ViewHint from './ViewHint.js';
|
||||
import {assert} from './asserts.js';
|
||||
import {removeNode} from './dom.js';
|
||||
import {listen, unlistenByKey, unlisten} from './events.js';
|
||||
import Event from './events/Event.js';
|
||||
import {stopPropagation} from './events/Event.js';
|
||||
import EventType from './events/EventType.js';
|
||||
import {createEmpty, clone, createOrUpdateEmpty, equals, getForViewAndSize, isEmpty} from './extent.js';
|
||||
import {TRUE} from './functions.js';
|
||||
@@ -248,8 +248,7 @@ const PluggableMap = function(options) {
|
||||
EventType.WHEEL
|
||||
];
|
||||
for (let i = 0, ii = overlayEvents.length; i < ii; ++i) {
|
||||
listen(this.overlayContainerStopEvent_, overlayEvents[i],
|
||||
Event.stopPropagation);
|
||||
listen(this.overlayContainerStopEvent_, overlayEvents[i], stopPropagation);
|
||||
}
|
||||
this.viewport_.appendChild(this.overlayContainerStopEvent_);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import Control from '../control/Control.js';
|
||||
import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
|
||||
import {easeOut} from '../easing.js';
|
||||
import {listen} from '../events.js';
|
||||
import Event from '../events/Event.js';
|
||||
import {stopPropagation} from '../events/Event.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {clamp} from '../math.js';
|
||||
import PointerEventType from '../pointer/EventType.js';
|
||||
@@ -130,10 +130,8 @@ const ZoomSlider = function(opt_options) {
|
||||
listen(this.dragger_, PointerEventType.POINTERUP,
|
||||
this.handleDraggerEnd_, this);
|
||||
|
||||
listen(containerElement, EventType.CLICK,
|
||||
this.handleContainerClick_, this);
|
||||
listen(thumbElement, EventType.CLICK,
|
||||
Event.stopPropagation);
|
||||
listen(containerElement, EventType.CLICK, this.handleContainerClick_, this);
|
||||
listen(thumbElement, EventType.CLICK, stopPropagation);
|
||||
|
||||
Control.call(this, {
|
||||
element: containerElement,
|
||||
|
||||
@@ -61,15 +61,16 @@ Event.prototype.preventDefault =
|
||||
/**
|
||||
* @param {Event|ol.events.Event} evt Event
|
||||
*/
|
||||
Event.stopPropagation = function(evt) {
|
||||
export function stopPropagation(evt) {
|
||||
evt.stopPropagation();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {Event|ol.events.Event} evt Event
|
||||
*/
|
||||
Event.preventDefault = function(evt) {
|
||||
export function preventDefault(evt) {
|
||||
evt.preventDefault();
|
||||
};
|
||||
}
|
||||
|
||||
export default Event;
|
||||
|
||||
Reference in New Issue
Block a user