mirror of
https://github.com/nasa/openmct.git
synced 2025-05-04 17:52:58 +00:00
[Fixed Position] Update positions when grid size changes
Update positions of elements in a fixed position view when grid size changes (e.g. when switching from one domain object to another.) WTD-1344.
This commit is contained in:
parent
d3ff49b90b
commit
791504584d
@ -60,7 +60,7 @@ define(
|
|||||||
cellStyles = [];
|
cellStyles = [];
|
||||||
|
|
||||||
// Update grid size from model
|
// Update grid size from model
|
||||||
gridSize = ($scope.model || {}).layoutGrid || gridSize;
|
gridSize = ($scope.model || {}).layoutGrid || DEFAULT_GRID_SIZE;
|
||||||
|
|
||||||
for (x = 0; x < gridExtent[0]; x += 1) {
|
for (x = 0; x < gridExtent[0]; x += 1) {
|
||||||
for (y = 0; y < gridExtent[1]; y += 1) {
|
for (y = 0; y < gridExtent[1]; y += 1) {
|
||||||
@ -136,6 +136,16 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update element positions when grid size changes
|
||||||
|
function updateElementPositions(layoutGrid) {
|
||||||
|
// Update grid size from model
|
||||||
|
gridSize = layoutGrid || DEFAULT_GRID_SIZE;
|
||||||
|
|
||||||
|
elementProxies.forEach(function (elementProxy) {
|
||||||
|
elementProxy.style = convertPosition(elementProxy);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Update telemetry values based on new data available
|
// Update telemetry values based on new data available
|
||||||
function updateValues() {
|
function updateValues() {
|
||||||
if (subscription) {
|
if (subscription) {
|
||||||
@ -277,6 +287,9 @@ define(
|
|||||||
// Position panes when the model field changes
|
// Position panes when the model field changes
|
||||||
$scope.$watch("model.composition", updateComposition);
|
$scope.$watch("model.composition", updateComposition);
|
||||||
|
|
||||||
|
// Detect changes to grid size
|
||||||
|
$scope.$watch("model.layoutGrid", updateElementPositions);
|
||||||
|
|
||||||
// Subscribe to telemetry when an object is available
|
// Subscribe to telemetry when an object is available
|
||||||
$scope.$watch("domainObject", subscribe);
|
$scope.$watch("domainObject", subscribe);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user