mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Make sure the $scope.canAddCollaborators
var is initialised at least once, outside of angular $watch
.
This commit is contained in:
parent
0b50623d51
commit
2ff211ce2c
1 changed files with 9 additions and 4 deletions
|
@ -19,11 +19,16 @@ define [
|
||||||
, 200
|
, 200
|
||||||
|
|
||||||
INFINITE_COLLABORATORS = -1
|
INFINITE_COLLABORATORS = -1
|
||||||
$scope.$watch "(project.members.length + project.invites.length)", (noOfMembers) ->
|
|
||||||
allowedNoOfMembers = $scope.project.features.collaborators
|
|
||||||
$scope.canAddCollaborators = noOfMembers < allowedNoOfMembers or allowedNoOfMembers == INFINITE_COLLABORATORS
|
|
||||||
|
|
||||||
window._m = projectMembers
|
$scope.refreshCanAddCollaborators = () ->
|
||||||
|
allowedNoOfMembers = $scope.project.features.collaborators
|
||||||
|
$scope.canAddCollaborators = (
|
||||||
|
($scope.project.members.length + $scope.project.invites.length) < allowedNoOfMembers or allowedNoOfMembers == INFINITE_COLLABORATORS
|
||||||
|
)
|
||||||
|
$scope.refreshCanAddCollaborators()
|
||||||
|
|
||||||
|
$scope.$watch "(project.members.length + project.invites.length)", (_noOfMembers) ->
|
||||||
|
$scope.refreshCanAddCollaborators()
|
||||||
|
|
||||||
$scope.autocompleteContacts = []
|
$scope.autocompleteContacts = []
|
||||||
do loadAutocompleteUsers = () ->
|
do loadAutocompleteUsers = () ->
|
||||||
|
|
Loading…
Reference in a new issue