From 83872946bf8f31896182204dc225e9df709ee7e7 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 19 Feb 2015 10:22:12 -0800 Subject: [PATCH] [Fixed Position] Fix grid size spec Fix spec which ensures that FixedController correctly populates background grid based on user-defined grid size, after changes for WTD-879. --- platform/features/layout/src/FixedController.js | 4 ++++ platform/features/layout/test/FixedControllerSpec.js | 1 + 2 files changed, 5 insertions(+) diff --git a/platform/features/layout/src/FixedController.js b/platform/features/layout/src/FixedController.js index 2fc798d891..88da08537a 100644 --- a/platform/features/layout/src/FixedController.js +++ b/platform/features/layout/src/FixedController.js @@ -30,8 +30,12 @@ define( function refreshCellStyles() { var x, y; + // Clear previous styles cellStyles = []; + // Update grid size from model + gridSize = ($scope.model || {}).layoutGrid || gridSize; + 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 diff --git a/platform/features/layout/test/FixedControllerSpec.js b/platform/features/layout/test/FixedControllerSpec.js index a4e67ac347..693c1c46d5 100644 --- a/platform/features/layout/test/FixedControllerSpec.js +++ b/platform/features/layout/test/FixedControllerSpec.js @@ -86,6 +86,7 @@ define( mockFormatter.formatRangeValue.andCallFake(function (v) { return "Formatted " + v; }); + mockScope.model = testModel; controller = new FixedController( mockScope,