Skip to content
Snippets Groups Projects
Commit 4b9355ae authored by Demian Katz's avatar Demian Katz
Browse files

Fixed problems with "retain filter" memory.

- eslint issues
- hidden checkboxes were not toggling correctly, so functionality was broken
parent 003fadb5
Branches
Tags
No related merge requests found
......@@ -363,10 +363,12 @@ $(document).ready(function commonDocReady() {
$('.facet.list-group .collapse').on('hidden.bs.collapse', facetSessionStorage);
// retain filter sessionStorage
$('.searchFormKeepFilters').click(function() {
sessionStorage.setItem('vufind_retain_filters', this.checked);
$('.searchFormKeepFilters').click(function retainFiltersInSessionStorage() {
sessionStorage.setItem('vufind_retain_filters', this.checked ? 'true' : 'false');
});
if (sessionStorage.getItem('vufind_retain_filters')) {
$('.searchFormKeepFilters').prop('checked', sessionStorage.getItem('vufind_retain_filters') == 'true');
var state = (sessionStorage.getItem('vufind_retain_filters') === 'true');
$('.searchFormKeepFilters').prop('checked', state);
$('.applied-filter').prop('checked', state);
}
});
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment