Add comments and minor changes from PR feedback

This commit is contained in:
gconsidine
2017-07-28 15:23:08 -04:00
parent 6239df6778
commit 6a7e018100
3 changed files with 27 additions and 7 deletions
@@ -81,6 +81,10 @@ function AtInputLookupController (baseInputController, $q, $state, $stateParams)
vm.search = () => {
scope.state._touched = true;
if (scope.state._displayValue === '' && !scope.state._required) {
return vm.check({ isValid: true });
}
return model.search({ [search.key]: scope.state._displayValue }, search.config)
.then(found => {
if (!found) {
@@ -105,8 +109,6 @@ function AtInputLookupController (baseInputController, $q, $state, $stateParams)
return vm.resetDebounce();
}
scope.state._touched = true;
vm.searchAfterDebounce();
};
}