浏览代码

Merge branch 'master-redesign' of github.com:sharelatex/web-sharelatex into master-redesign

James Allen 12 年之前
父节点
当前提交
661cfcb2c1
共有 1 个文件被更改,包括 4 次插入 和 0 次删除
  1. 4 0
      services/web/public/coffee/main/user-details.coffee

+ 4 - 0
services/web/public/coffee/main/user-details.coffee

@@ -49,6 +49,10 @@ define [
 			# listen for blur events on institution field to send the post
 			# listen for blur events on institution field to send the post
 			if inputVal?.indexOf("(") != -1 and inputVal?.indexOf(")") != -1 
 			if inputVal?.indexOf("(") != -1 and inputVal?.indexOf(")") != -1 
 				$scope.sendUpdate()
 				$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)->
 			Institutions.search $scope.userInfoForm.institution, (err, response)->
 				$scope.institutions = _.map response.hits, (institution)->
 				$scope.institutions = _.map response.hits, (institution)->