mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
don't search for instituion until we get a few chars. Saves some usless algolia http calls
This commit is contained in:
parent
8d946e68d2
commit
4bc47bd2b2
1 changed files with 4 additions and 0 deletions
|
@ -49,6 +49,10 @@ define [
|
|||
# listen for blur events on institution field to send the post
|
||||
if inputVal?.indexOf("(") != -1 and inputVal?.indexOf(")") != -1
|
||||
$scope.sendUpdate()
|
||||
|
||||
query = $scope.userInfoForm.institution
|
||||
if query?.length <= 3
|
||||
return #saves us algolia searches, need ~4 chars to get uni anyway
|
||||
|
||||
Institutions.search $scope.userInfoForm.institution, (err, response)->
|
||||
$scope.institutions = _.map response.hits, (institution)->
|
||||
|
|
Loading…
Reference in a new issue