[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:
Victor Woeltjen 2015-06-25 10:48:49 -07:00
parent 791504584d
commit 4279c9e4bf

View File

@ -43,7 +43,6 @@ define(
gridExtent = DEFAULT_GRID_EXTENT,
dragging,
subscription,
cellStyles = [],
elementProxies = [],
names = {}, // Cache names by ID
values = {}, // Cache values by ID
@ -52,29 +51,6 @@ define(
moveHandle,
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
// apropriate ng-style argument, to position elements.
function convertPosition(elementProxy) {
@ -299,19 +275,7 @@ define(
// Position panes where they are dropped
$scope.$on("mctDrop", handleDrop);
// Initialize styles (position etc.) for cells
refreshCellStyles();
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
* is in the form `[x, y]`.
@ -330,7 +294,6 @@ define(
h = Math.ceil(bounds.height / gridSize[1]);
if (w !== gridExtent[0] || h !== gridExtent[1]) {
gridExtent = [w, h];
refreshCellStyles();
}
},
/**