Merge pull request #396 from marshmalien/fix/7591-quirky-lookup-modals

Fix form field lookup by populating the field name
This commit is contained in:
Marliana Lara 2017-09-08 13:46:39 -04:00 committed by GitHub
commit 7a2a4cc4a9

View File

@ -29,10 +29,8 @@ export default ['templateUrl', function(templateUrl) {
$scope.init = function() {
let list = $scope.list;
if($state.params.selected) {
$scope.currentSelection = {
name: null,
id: parseInt($state.params.selected)
};
let selection = $scope[list.name].find(({id}) => id === parseInt($state.params.selected));
$scope.currentSelection = _.pick(selection, 'id', 'name');
}
$scope.$watch(list.name, function(){
selectRowIfPresent();