mirror of
https://github.com/nasa/openmct.git
synced 2025-05-02 08:43:17 +00:00
[Templates] Watch for selection object
...from Timeline, to ensure toolbar appears etc. Reflects changes to ordering triggered by use of template instead of templateUrl
This commit is contained in:
parent
931fa77cbe
commit
f3fd2e67fc
@ -98,10 +98,13 @@ define(
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Recalculate swimlane state on changes
|
||||
$scope.$watch("domainObject", swimlanePopulator.populate);
|
||||
|
||||
// Pass selection object into swimlane populator
|
||||
$scope.$watch("selection", swimlanePopulator.selection);
|
||||
|
||||
// Also recalculate whenever anything in view is modified
|
||||
$scope.$watch(modificationSum, repopulateSwimlanes);
|
||||
|
||||
|
@ -46,7 +46,8 @@ define(
|
||||
start = Number.POSITIVE_INFINITY,
|
||||
end = Number.NEGATIVE_INFINITY,
|
||||
colors = (configuration.colors || {}),
|
||||
assigner = new TimelineColorAssigner(colors);
|
||||
assigner = new TimelineColorAssigner(colors),
|
||||
lastDomainObject;
|
||||
|
||||
// Track extremes of start/end times
|
||||
function trackStartEnd(timespan) {
|
||||
@ -144,12 +145,25 @@ define(
|
||||
domainObject && new TimelineProxy(domainObject, selection)
|
||||
);
|
||||
}
|
||||
|
||||
lastDomainObject = domainObject;
|
||||
}
|
||||
|
||||
function setSelectionObject(s) {
|
||||
selection = s;
|
||||
recalculateSwimlanes(lastDomainObject);
|
||||
}
|
||||
|
||||
// Ensure colors are exposed in configuration
|
||||
configuration.colors = colors;
|
||||
|
||||
return {
|
||||
/**
|
||||
* Set the selection object associated with this timeline view.
|
||||
* @param {Object} selection the selection object
|
||||
*/
|
||||
selection: setSelectionObject,
|
||||
|
||||
/**
|
||||
* Update list of swimlanes to match those reachable from this
|
||||
* object.
|
||||
|
Loading…
x
Reference in New Issue
Block a user