Fixes #5094 Now show list based on whether or not a search query is defined. The autocomplete function from the directive is encapsulated so that it can be called and then the query can be set to null.

This commit is contained in:
Joy Clark
2015-05-03 18:14:28 +02:00
parent 9b22ac68da
commit 4450a5d7c3
3 changed files with 22 additions and 3 deletions

View File

@@ -232,6 +232,11 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
return user.indexOf(text) == 0;
}
$scope.performCompletion = function(msg) {
$scope.autoComplete(msg);
$scope.query = null;
}
$scope.addNewUser = function(user) {
if($.inArray(user.user,$scope.usernames) == -1) {
user.username = user.user;