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:
Deep Tailor
2018-07-26 12:21:10 -07:00
parent 0fa4486dcf
commit 00ecd27bb3

View File

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