Dispatch generic changed events when any ol.Object property changes
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
goog.provide('ol.Object');
|
||||
goog.provide('ol.ObjectEventType');
|
||||
|
||||
goog.require('goog.array');
|
||||
goog.require('goog.events');
|
||||
@@ -13,6 +14,14 @@ goog.require('goog.events.EventTarget');
|
||||
goog.require('goog.object');
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.ObjectEventType = {
|
||||
CHANGED: 'changed'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
@@ -192,6 +201,7 @@ ol.Object.prototype.notify = function(key) {
|
||||
ol.Object.prototype.notifyInternal_ = function(key) {
|
||||
var eventType = ol.Object.getChangedEventType(key);
|
||||
this.dispatchEvent(eventType);
|
||||
this.dispatchEvent(ol.ObjectEventType.CHANGED);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user