[Fixed Position] Expose view proxy

Expose view proxy as selection state from the Fixed Position
controller, to make Add button available under generalized
selection mechanism, WTD-929.
This commit is contained in:
Victor Woeltjen 2015-03-03 18:52:13 -08:00
parent 6364296967
commit 3ce1064c4e
2 changed files with 13 additions and 2 deletions

View File

@ -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);

View File

@ -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)
);
});
});
}
);