mirror of
https://github.com/nasa/openmct.git
synced 2025-02-08 03:50:39 +00:00
[Fixed Position] Remove obsolete cell styles
Remove obsolete cell style calculations; background grid is handled by CSS now. Changed in the context of WTD-1344.
This commit is contained in:
parent
791504584d
commit
4279c9e4bf
@ -43,7 +43,6 @@ define(
|
|||||||
gridExtent = DEFAULT_GRID_EXTENT,
|
gridExtent = DEFAULT_GRID_EXTENT,
|
||||||
dragging,
|
dragging,
|
||||||
subscription,
|
subscription,
|
||||||
cellStyles = [],
|
|
||||||
elementProxies = [],
|
elementProxies = [],
|
||||||
names = {}, // Cache names by ID
|
names = {}, // Cache names by ID
|
||||||
values = {}, // Cache values by ID
|
values = {}, // Cache values by ID
|
||||||
@ -52,29 +51,6 @@ define(
|
|||||||
moveHandle,
|
moveHandle,
|
||||||
selection;
|
selection;
|
||||||
|
|
||||||
// Refresh cell styles (e.g. because grid extent changed)
|
|
||||||
function refreshCellStyles() {
|
|
||||||
var x, y;
|
|
||||||
|
|
||||||
// Clear previous styles
|
|
||||||
cellStyles = [];
|
|
||||||
|
|
||||||
// Update grid size from model
|
|
||||||
gridSize = ($scope.model || {}).layoutGrid || DEFAULT_GRID_SIZE;
|
|
||||||
|
|
||||||
for (x = 0; x < gridExtent[0]; x += 1) {
|
|
||||||
for (y = 0; y < gridExtent[1]; y += 1) {
|
|
||||||
// Position blocks; subtract out border size from w/h
|
|
||||||
cellStyles.push({
|
|
||||||
left: x * gridSize[0] + 'px',
|
|
||||||
top: y * gridSize[1] + 'px',
|
|
||||||
width: gridSize[0] - 1 + 'px',
|
|
||||||
height: gridSize[1] - 1 + 'px'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert from element x/y/width/height to an
|
// Convert from element x/y/width/height to an
|
||||||
// apropriate ng-style argument, to position elements.
|
// apropriate ng-style argument, to position elements.
|
||||||
function convertPosition(elementProxy) {
|
function convertPosition(elementProxy) {
|
||||||
@ -299,19 +275,7 @@ define(
|
|||||||
// Position panes where they are dropped
|
// Position panes where they are dropped
|
||||||
$scope.$on("mctDrop", handleDrop);
|
$scope.$on("mctDrop", handleDrop);
|
||||||
|
|
||||||
// Initialize styles (position etc.) for cells
|
|
||||||
refreshCellStyles();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
|
||||||
* Get styles for all background cells, as will populate the
|
|
||||||
* ng-style tag.
|
|
||||||
* @memberof FixedController#
|
|
||||||
* @returns {Array} cell styles
|
|
||||||
*/
|
|
||||||
getCellStyles: function () {
|
|
||||||
return cellStyles;
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Get the size of the grid, in pixels. The returned array
|
* Get the size of the grid, in pixels. The returned array
|
||||||
* is in the form `[x, y]`.
|
* is in the form `[x, y]`.
|
||||||
@ -330,7 +294,6 @@ define(
|
|||||||
h = Math.ceil(bounds.height / gridSize[1]);
|
h = Math.ceil(bounds.height / gridSize[1]);
|
||||||
if (w !== gridExtent[0] || h !== gridExtent[1]) {
|
if (w !== gridExtent[0] || h !== gridExtent[1]) {
|
||||||
gridExtent = [w, h];
|
gridExtent = [w, h];
|
||||||
refreshCellStyles();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user