mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
a proposed solution to issue #1866 Redefined the filter function to match based on prefix
This commit is contained in:
@@ -220,6 +220,13 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
||||
$scope.usernames = [];
|
||||
}
|
||||
|
||||
$scope.filterUser = function(item) {
|
||||
if ($scope.query === undefined || $scope.query === null) {
|
||||
return true;
|
||||
}
|
||||
return item.user.indexOf($scope.query.text) == 0; // query should be prefix of item.user
|
||||
}
|
||||
|
||||
$scope.addNewUser = function(user) {
|
||||
if($.inArray(user.user,$scope.usernames) == -1) {
|
||||
user.username = user.user;
|
||||
|
||||
Reference in New Issue
Block a user