Dispatch generic changed events when any ol.Object property changes

This commit is contained in:
Tom Payne
2013-01-08 17:26:22 +01:00
parent 20e0557a4d
commit 21331d1065
2 changed files with 39 additions and 8 deletions

View File

@@ -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);
};