Simplify events and store listeners only in one place
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* for higher level events defined in the library, and works with
|
||||
* {@link module:ol/events/Target~Target}.
|
||||
*/
|
||||
class Event {
|
||||
class BaseEvent {
|
||||
|
||||
/**
|
||||
* @param {string} type Type.
|
||||
@@ -73,4 +73,4 @@ export function preventDefault(evt) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
|
||||
export default Event;
|
||||
export default BaseEvent;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* @module ol/events/Target
|
||||
*/
|
||||
import Disposable from '../Disposable.js';
|
||||
import {unlistenAll} from '../events.js';
|
||||
import {VOID} from '../functions.js';
|
||||
import Event from './Event.js';
|
||||
import {clear} from '../obj.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -116,7 +116,7 @@ class Target extends Disposable {
|
||||
* @inheritDoc
|
||||
*/
|
||||
disposeInternal() {
|
||||
unlistenAll(this);
|
||||
clear(this.listeners_);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user