mirror of
https://github.com/nasa/openmct.git
synced 2025-01-18 18:57:01 +00:00
event emitter uses keystring instead of key, to avoid broadcasting to all domainObjects that share the same key' (#2350)
This commit is contained in:
parent
97ccaa58c7
commit
4189a05758
@ -57,8 +57,10 @@ define([
|
||||
}.bind(this);
|
||||
|
||||
handleLegacyMutation = function (legacyObject) {
|
||||
var newStyleObject = utils.toNewFormat(legacyObject.getModel(), legacyObject.getId());
|
||||
this.eventEmitter.emit(newStyleObject.identifier.key + ":*", newStyleObject);
|
||||
var newStyleObject = utils.toNewFormat(legacyObject.getModel(), legacyObject.getId()),
|
||||
keystring = utils.makeKeyString(newStyleObject.identifier);
|
||||
|
||||
this.eventEmitter.emit(keystring + ":*", newStyleObject);
|
||||
this.eventEmitter.emit('mutation', newStyleObject);
|
||||
}.bind(this);
|
||||
|
||||
|
@ -21,8 +21,10 @@
|
||||
*****************************************************************************/
|
||||
|
||||
define([
|
||||
'./object-utils.js',
|
||||
'lodash'
|
||||
], function (
|
||||
utils,
|
||||
_
|
||||
) {
|
||||
var ANY_OBJECT_EVENT = "mutation";
|
||||
@ -41,7 +43,9 @@ define([
|
||||
}
|
||||
|
||||
function qualifiedEventName(object, eventName) {
|
||||
return [object.identifier.key, eventName].join(':');
|
||||
var keystring = utils.makeKeyString(object.identifier);
|
||||
|
||||
return [keystring, eventName].join(':');
|
||||
}
|
||||
|
||||
MutableObject.prototype.stopListening = function () {
|
||||
|
Loading…
Reference in New Issue
Block a user