mirror of
https://github.com/nasa/openmct.git
synced 2025-05-03 09:12:51 +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
@ -102,6 +102,9 @@ define(
|
|||||||
// Recalculate swimlane state on changes
|
// Recalculate swimlane state on changes
|
||||||
$scope.$watch("domainObject", swimlanePopulator.populate);
|
$scope.$watch("domainObject", swimlanePopulator.populate);
|
||||||
|
|
||||||
|
// Pass selection object into swimlane populator
|
||||||
|
$scope.$watch("selection", swimlanePopulator.selection);
|
||||||
|
|
||||||
// Also recalculate whenever anything in view is modified
|
// Also recalculate whenever anything in view is modified
|
||||||
$scope.$watch(modificationSum, repopulateSwimlanes);
|
$scope.$watch(modificationSum, repopulateSwimlanes);
|
||||||
|
|
||||||
|
@ -46,7 +46,8 @@ define(
|
|||||||
start = Number.POSITIVE_INFINITY,
|
start = Number.POSITIVE_INFINITY,
|
||||||
end = Number.NEGATIVE_INFINITY,
|
end = Number.NEGATIVE_INFINITY,
|
||||||
colors = (configuration.colors || {}),
|
colors = (configuration.colors || {}),
|
||||||
assigner = new TimelineColorAssigner(colors);
|
assigner = new TimelineColorAssigner(colors),
|
||||||
|
lastDomainObject;
|
||||||
|
|
||||||
// Track extremes of start/end times
|
// Track extremes of start/end times
|
||||||
function trackStartEnd(timespan) {
|
function trackStartEnd(timespan) {
|
||||||
@ -144,12 +145,25 @@ define(
|
|||||||
domainObject && new TimelineProxy(domainObject, selection)
|
domainObject && new TimelineProxy(domainObject, selection)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastDomainObject = domainObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setSelectionObject(s) {
|
||||||
|
selection = s;
|
||||||
|
recalculateSwimlanes(lastDomainObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure colors are exposed in configuration
|
// Ensure colors are exposed in configuration
|
||||||
configuration.colors = colors;
|
configuration.colors = colors;
|
||||||
|
|
||||||
return {
|
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
|
* Update list of swimlanes to match those reachable from this
|
||||||
* object.
|
* object.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user