Skip to content

Commit

Permalink
increase delay to refresh based on keyword. save last keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-satish committed Mar 31, 2016
1 parent db7f93f commit 66e0cb6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hasjob/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,13 @@ window.Hasjob.Filters = {
window.Hasjob.StickieList.refresh();
});

var lastKeyword;
$('.js-handle-keyword-update').on('keyup', function(){
window.clearTimeout(keywordTimeout);
keywordTimeout = window.setTimeout(window.Hasjob.StickieList.refresh, 500);
if ($(this).val() !== lastKeyword){
window.clearTimeout(keywordTimeout);
lastKeyword = $(this).val();
keywordTimeout = window.setTimeout(window.Hasjob.StickieList.refresh, 1000);
}
});

$('#job-filters-location').multiselect({
Expand Down

0 comments on commit 66e0cb6

Please sign in to comment.