Use extends and super for control/Control

This commit is contained in:
ahocevar
2018-07-17 14:25:26 +02:00
parent 49c4a75777
commit 322a51d822

View File

@@ -1,7 +1,6 @@
/**
* @module ol/control/Control
*/
import {inherits} from '../util.js';
import {UNDEFINED} from '../functions.js';
import MapEventType from '../MapEventType.js';
import BaseObject from '../Object.js';
@@ -45,14 +44,13 @@ import {listen, unlistenByKey} from '../events.js';
* examples/custom-controls for an example of how to do this.
*
* @constructor
* @extends {module:ol/Object}
* @param {module:ol/control/Control~Options} options Control options.
* @api
*/
class Control {
class Control extends BaseObject {
constructor(options) {
BaseObject.call(this);
super();
/**
* @protected
@@ -94,7 +92,7 @@ class Control {
*/
disposeInternal() {
removeNode(this.element);
BaseObject.prototype.disposeInternal.call(this);
super.disposeInternal();
}
/**
@@ -150,7 +148,5 @@ class Control {
}
}
inherits(Control, BaseObject);
export default Control;