Skip to content

Commit

Permalink
fixes #336
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-satish committed May 14, 2016
1 parent a0f850b commit a7e8a4c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hasjob/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ window.Hasjob.Filters = {
return sortedFilterParams;
},
refresh: function() {
// Capture initial cursor position in the keywords field
var keywordsField = document.getElementById('job-filters-keywords');
var initialKeywordPos = keywordsField.selectionEnd;

// reset pre-selected values in filters
this.ractive.set({
jobsArchive: window.Hasjob.Config.jobsArchive,
jobLocations: window.Hasjob.Config.jobLocationFilters,
Expand All @@ -452,9 +457,13 @@ window.Hasjob.Filters = {
pay: window.Hasjob.Config.pay,
equity: window.Hasjob.Config.equity
}).then(function() {
// Since the data may have changed, multiselect requires a rebuild
$('#job-filters-location').multiselect('rebuild');
$('#job-filters-type').multiselect('rebuild');
$('#job-filters-category').multiselect('rebuild');

// Set the cursor back to where it was before refresh
keywordsField.selectionEnd = initialKeywordPos;
});
}
};
Expand Down

0 comments on commit a7e8a4c

Please sign in to comment.