Properly debounce searching and make sure to only show results matching the current query.
This commit is contained in:
parent
48f3e9af1d
commit
5ae2975134
5 changed files with 70 additions and 3 deletions
|
@ -36,7 +36,7 @@ quayPages.constant('pages', {
|
|||
});
|
||||
|
||||
quayDependencies = ['ngRoute', 'chieffancypants.loadingBar', 'cfp.hotkeys', 'angular-tour', 'restangular', 'angularMoment',
|
||||
'mgcrea.ngStrap', 'ngCookies', 'ngSanitize', 'angular-md5', 'pasvaz.bindonce', 'ansiToHtml',
|
||||
'mgcrea.ngStrap', 'ngCookies', 'ngSanitize', 'angular-md5', 'pasvaz.bindonce', 'ansiToHtml', 'debounce',
|
||||
'core-ui', 'core-config-setup', 'quayPages'];
|
||||
|
||||
if (window.__config && window.__config.MIXPANEL_KEY) {
|
||||
|
|
|
@ -47,7 +47,6 @@ angular.module('quay').directive('headerBar', function () {
|
|||
// Monitor any user changes and place the current user into the scope.
|
||||
UserService.updateUserIn($scope);
|
||||
|
||||
|
||||
$scope.currentPageContext = {};
|
||||
|
||||
$rootScope.$watch('currentPage.scope.viewuser', function(u) {
|
||||
|
@ -74,7 +73,7 @@ angular.module('quay').directive('headerBar', function () {
|
|||
};
|
||||
|
||||
ApiService.conductSearch(null, params).then(function(resp) {
|
||||
if (!$scope.searchVisible) { return; }
|
||||
if (!$scope.searchVisible || query != $scope.currentSearchQuery) { return; }
|
||||
|
||||
$scope.searchResultState = {
|
||||
'state': resp.results.length ? 'results' : 'no-results',
|
||||
|
|
Reference in a new issue