Skip to content

Commit

Permalink
Fix hiding of date range from filter params in multi-facet selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Nov 20, 2024
1 parent b54a9b2 commit d20b634
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions themes/bootstrap3/js/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,16 @@ VuFind.register('multiFacetsSelection', function multiFacetsSelection() {

// Make sure NOT to have a specific range filter parameter in the final URL
function hideRangeFilterFromFinalUrl(rangeName) {
const paramStart = encodeURIComponent(rangeName + ':');
for (const [value] of initialParams.getAll('filter[]')) {
const paramStart = rangeName + ':';
for (const value of initialParams.getAll('filter[]')) {
if (value.startsWith(paramStart)) {
globalRemovedParams.push(encodeURI('filter[]=' + value));
globalRemovedParams.append('filter[]', value);
return;
}
}
for (const [value] of globalAddedParams.getAll('filter[]')) {
for (const value of globalAddedParams.getAll('filter[]')) {
if (value.startsWith(paramStart)) {
globalAddedParams.remove('filter[]', value);
globalAddedParams.delete('filter[]', value);
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions themes/bootstrap5/js/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,16 @@ VuFind.register('multiFacetsSelection', function multiFacetsSelection() {

// Make sure NOT to have a specific range filter parameter in the final URL
function hideRangeFilterFromFinalUrl(rangeName) {
const paramStart = encodeURIComponent(rangeName + ':');
for (const [value] of initialParams.getAll('filter[]')) {
const paramStart = rangeName + ':';
for (const value of initialParams.getAll('filter[]')) {
if (value.startsWith(paramStart)) {
globalRemovedParams.push(encodeURI('filter[]=' + value));
globalRemovedParams.append('filter[]', value);
return;
}
}
for (const [value] of globalAddedParams.getAll('filter[]')) {
for (const value of globalAddedParams.getAll('filter[]')) {
if (value.startsWith(paramStart)) {
globalAddedParams.remove('filter[]', value);
globalAddedParams.delete('filter[]', value);
}
}
}
Expand Down

0 comments on commit d20b634

Please sign in to comment.