mirror of
https://github.com/nasa/openmct.git
synced 2025-06-17 22:58:14 +00:00
fixes #2130
fix lingering event listener that was caused by function (setSelection) being stored in two different locations, causing pointer mis match
This commit is contained in:
@ -87,7 +87,8 @@ define(
|
|||||||
'setDisplayedValue',
|
'setDisplayedValue',
|
||||||
'subscribeToObject',
|
'subscribeToObject',
|
||||||
'unsubscribe',
|
'unsubscribe',
|
||||||
'updateView'
|
'updateView',
|
||||||
|
'setSelection'
|
||||||
].forEach(function (name) {
|
].forEach(function (name) {
|
||||||
self[name] = self[name].bind(self);
|
self[name] = self[name].bind(self);
|
||||||
});
|
});
|
||||||
@ -170,7 +171,7 @@ define(
|
|||||||
|
|
||||||
if (self.selectedElementProxy) {
|
if (self.selectedElementProxy) {
|
||||||
// Update the selected element with the new
|
// Update the selected element with the new
|
||||||
// value since newDomainOject is mutated.
|
// value since newDomainOject is mutated.fde
|
||||||
self.selectedElementProxy.element = elements[index];
|
self.selectedElementProxy.element = elements[index];
|
||||||
}
|
}
|
||||||
refreshElements();
|
refreshElements();
|
||||||
@ -224,7 +225,7 @@ define(
|
|||||||
// Respond to external bounds changes
|
// Respond to external bounds changes
|
||||||
this.openmct.time.on("bounds", updateDisplayBounds);
|
this.openmct.time.on("bounds", updateDisplayBounds);
|
||||||
|
|
||||||
this.openmct.selection.on('change', this.setSelection.bind(this));
|
this.openmct.selection.on('change', this.setSelection);
|
||||||
this.$element.on('click', this.bypassSelection.bind(this));
|
this.$element.on('click', this.bypassSelection.bind(this));
|
||||||
this.unlisten = this.openmct.objects.observe(this.newDomainObject, '*', function (obj) {
|
this.unlisten = this.openmct.objects.observe(this.newDomainObject, '*', function (obj) {
|
||||||
this.newDomainObject = JSON.parse(JSON.stringify(obj));
|
this.newDomainObject = JSON.parse(JSON.stringify(obj));
|
||||||
|
Reference in New Issue
Block a user