|
|
@ -2057,6 +2057,7 @@ angular.module('myApp.controllers', []) |
|
|
|
} |
|
|
|
} |
|
|
|
$scope.contacts.push(contact); |
|
|
|
$scope.contacts.push(contact); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
$scope.contactsEmpty = query ? false : !$scope.contacts.length; |
|
|
|
$scope.$broadcast('contacts_change'); |
|
|
|
$scope.$broadcast('contacts_change'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -2313,6 +2314,10 @@ angular.module('myApp.controllers', []) |
|
|
|
$scope.toggleSelection(true); |
|
|
|
$scope.toggleSelection(true); |
|
|
|
phonebookReady = true; |
|
|
|
phonebookReady = true; |
|
|
|
updateList(); |
|
|
|
updateList(); |
|
|
|
|
|
|
|
}, function (error) { |
|
|
|
|
|
|
|
ErrorService.show({ |
|
|
|
|
|
|
|
error: {code: 403, type: 'PHONEBOOK_GET_CONTACTS_FAILED', originalError: error} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function updateList () { |
|
|
|
function updateList () { |
|
|
@ -2324,6 +2329,7 @@ angular.module('myApp.controllers', []) |
|
|
|
results = SearchIndexManager.search($scope.search.query, searchIndex); |
|
|
|
results = SearchIndexManager.search($scope.search.query, searchIndex); |
|
|
|
|
|
|
|
|
|
|
|
$scope.contacts = []; |
|
|
|
$scope.contacts = []; |
|
|
|
|
|
|
|
delete $scope.contactsEmpty; |
|
|
|
for (var i = 0; i < $scope.phonebook.length; i++) { |
|
|
|
for (var i = 0; i < $scope.phonebook.length; i++) { |
|
|
|
if (!filtered || results[i]) { |
|
|
|
if (!filtered || results[i]) { |
|
|
|
$scope.contacts.push($scope.phonebook[i]); |
|
|
|
$scope.contacts.push($scope.phonebook[i]); |
|
|
@ -2331,6 +2337,7 @@ angular.module('myApp.controllers', []) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$scope.contacts = $scope.phonebook; |
|
|
|
$scope.contacts = $scope.phonebook; |
|
|
|
|
|
|
|
$scope.contactsEmpty = !$scope.contacts.length; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scope.slice.limit = 20; |
|
|
|
$scope.slice.limit = 20; |
|
|
|