mirror of
https://github.com/nasa/openmct.git
synced 2024-12-22 06:27:48 +00:00
Merge pull request #2129 from nasa/fixed-position-2125
[Fixed Position] Cannot add on objects when creating Fixed Position for the first time
This commit is contained in:
commit
622d246fdd
@ -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);
|
||||||
});
|
});
|
||||||
@ -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));
|
||||||
@ -233,6 +234,9 @@ define(
|
|||||||
|
|
||||||
this.updateElementPositions(this.newDomainObject.layoutGrid);
|
this.updateElementPositions(this.newDomainObject.layoutGrid);
|
||||||
refreshElements();
|
refreshElements();
|
||||||
|
|
||||||
|
//force a click, to initialize Fixed Position Controller on SelectionAPI
|
||||||
|
$element[0].click();
|
||||||
}
|
}
|
||||||
|
|
||||||
FixedController.prototype.updateElementPositions = function (layoutGrid) {
|
FixedController.prototype.updateElementPositions = function (layoutGrid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user