mirror of
https://github.com/nasa/openmct.git
synced 2025-06-10 19:31:42 +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);
|
}.bind(this);
|
||||||
|
|
||||||
handleLegacyMutation = function (legacyObject) {
|
handleLegacyMutation = function (legacyObject) {
|
||||||
var newStyleObject = utils.toNewFormat(legacyObject.getModel(), legacyObject.getId());
|
var newStyleObject = utils.toNewFormat(legacyObject.getModel(), legacyObject.getId()),
|
||||||
this.eventEmitter.emit(newStyleObject.identifier.key + ":*", newStyleObject);
|
keystring = utils.makeKeyString(newStyleObject.identifier);
|
||||||
|
|
||||||
|
this.eventEmitter.emit(keystring + ":*", newStyleObject);
|
||||||
this.eventEmitter.emit('mutation', newStyleObject);
|
this.eventEmitter.emit('mutation', newStyleObject);
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
|
@ -21,8 +21,10 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
define([
|
define([
|
||||||
|
'./object-utils.js',
|
||||||
'lodash'
|
'lodash'
|
||||||
], function (
|
], function (
|
||||||
|
utils,
|
||||||
_
|
_
|
||||||
) {
|
) {
|
||||||
var ANY_OBJECT_EVENT = "mutation";
|
var ANY_OBJECT_EVENT = "mutation";
|
||||||
@ -41,7 +43,9 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
function qualifiedEventName(object, eventName) {
|
function qualifiedEventName(object, eventName) {
|
||||||
return [object.identifier.key, eventName].join(':');
|
var keystring = utils.makeKeyString(object.identifier);
|
||||||
|
|
||||||
|
return [keystring, eventName].join(':');
|
||||||
}
|
}
|
||||||
|
|
||||||
MutableObject.prototype.stopListening = function () {
|
MutableObject.prototype.stopListening = function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user