Add ol.Object#onOnce
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
@exportProperty ol.Object.prototype.get
|
||||
@exportProperty ol.Object.prototype.notify
|
||||
@exportProperty ol.Object.prototype.on
|
||||
@exportProperty ol.Object.prototype.onOnce
|
||||
@exportProperty ol.Object.prototype.set
|
||||
@exportProperty ol.Object.prototype.setOptions
|
||||
@exportProperty ol.Object.prototype.setValues
|
||||
|
||||
@@ -235,6 +235,18 @@ ol.Object.prototype.on = function(type, listener, opt_scope) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} type The event type.
|
||||
* @param {Function} listener The listener function.
|
||||
* @param {Object=} opt_scope Object is whose scope to call
|
||||
* the listener.
|
||||
* @return {?number} Unique key for the listener.
|
||||
*/
|
||||
ol.Object.prototype.onOnce = function(type, listener, opt_scope) {
|
||||
return goog.events.listenOnce(this, type, listener, false, opt_scope);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} key Key.
|
||||
* @param {*} value Value.
|
||||
|
||||
Reference in New Issue
Block a user