KEYCLOAK-3633: Don't search on initial page load.

This commit is contained in:
Stan Silvert 2016-10-03 15:02:11 -04:00
parent ab8803a5d6
commit 9b10110dcb
2 changed files with 3 additions and 1 deletions

View file

@ -248,7 +248,7 @@ module.controller('UserListCtrl', function($scope, realm, User, UserSearchState,
UserSearchState.query.realm = realm.realm;
$scope.query = UserSearchState.query;
$scope.searchQuery();
if (!UserSearchState.isFirstSearch) $scope.searchQuery();
};
$scope.impersonate = function(userId) {
@ -293,6 +293,7 @@ module.controller('UserListCtrl', function($scope, realm, User, UserSearchState,
$scope.users = User.query($scope.query, function() {
$scope.searchLoaded = true;
$scope.lastSearch = $scope.query.search;
UserSearchState.isFirstSearch = false;
});
};

View file

@ -347,6 +347,7 @@ module.factory('User', function($resource) {
});
module.service('UserSearchState', function() {
this.isFirstSearch = true;
this.query = {
max : 20,
first : 0