diff --git a/platform/features/layout/src/FixedController.js b/platform/features/layout/src/FixedController.js index fc71829e8b..60bc813c80 100644 --- a/platform/features/layout/src/FixedController.js +++ b/platform/features/layout/src/FixedController.js @@ -208,9 +208,14 @@ define( }); } - // Track current selection state + // Track current selection state selection = $scope.selection; + // Expose the view's selection proxy + if (selection) { + selection.proxy(new FixedProxy(addElement, $q, dialogService)); + } + // Refresh list of elements whenever model changes $scope.$watch("model.modified", refreshElements); diff --git a/platform/features/layout/test/FixedControllerSpec.js b/platform/features/layout/test/FixedControllerSpec.js index 5028812c0e..68562a0e28 100644 --- a/platform/features/layout/test/FixedControllerSpec.js +++ b/platform/features/layout/test/FixedControllerSpec.js @@ -104,7 +104,7 @@ define( mockScope.configuration = testConfiguration; mockScope.selection = jasmine.createSpyObj( 'selection', - [ 'select', 'get', 'selected', 'deselect' ] + [ 'select', 'get', 'selected', 'deselect', 'proxy' ] ); controller = new FixedController( @@ -297,6 +297,12 @@ define( // elements to size SVGs appropriately expect(controller.getGridSize()).toEqual(testGrid); }); + + it("exposes a view-level selection proxy", function () { + expect(mockScope.selection.proxy).toHaveBeenCalledWith( + jasmine.any(Object) + ); + }); }); } ); \ No newline at end of file