mirror of
https://github.com/nasa/openmct.git
synced 2025-05-02 16:53:24 +00:00
[Templates] Handle deferred selection availability
Loading templates via RequireJS text plugin means they are immediately available; appears to have caused a change in ordering wherein controllers for views may be initialized before representers have installed things like selection state. As such, need to watch for changes instead of simply checking for a selection object when the controller is initialized.
This commit is contained in:
parent
596735352a
commit
931fa77cbe
@ -303,12 +303,16 @@ define(
|
|||||||
this.generateDragHandles = generateDragHandles;
|
this.generateDragHandles = generateDragHandles;
|
||||||
|
|
||||||
// Track current selection state
|
// Track current selection state
|
||||||
this.selection = $scope.selection;
|
$scope.$watch("selection", function (selection) {
|
||||||
|
this.selection = selection;
|
||||||
|
|
||||||
// Expose the view's selection proxy
|
// Expose the view's selection proxy
|
||||||
if (this.selection) {
|
if (this.selection) {
|
||||||
this.selection.proxy(new FixedProxy(addElement, $q, dialogService));
|
this.selection.proxy(
|
||||||
}
|
new FixedProxy(addElement, $q, dialogService)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
// Refresh list of elements whenever model changes
|
// Refresh list of elements whenever model changes
|
||||||
$scope.$watch("model.modified", refreshElements);
|
$scope.$watch("model.modified", refreshElements);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user