support defining filters in url
This commit is contained in:
parent
1ac3910259
commit
2a3f4aea47
|
@ -94,7 +94,17 @@ $(() => {
|
|||
$paginationNext.click(() => updatePagination(1))
|
||||
updatePagination(0)
|
||||
|
||||
$cell.find('select[data-criteria]').each((_, elem) => $(elem).select2())
|
||||
const queryParams = (new URL(document.location)).searchParams;
|
||||
$cell.find('select[data-criteria]').each((_, element) => {
|
||||
const $element = $(element)
|
||||
$element.select2()
|
||||
const criteriaValues = queryParams.get(element.dataset.criteria)
|
||||
if (criteriaValues !== null) {
|
||||
$element.val(criteriaValues.split(','))
|
||||
$element.trigger('change')
|
||||
}
|
||||
})
|
||||
|
||||
$cell.find('select[data-criteria]').on('change', evt => {
|
||||
let selectedCriterias = []
|
||||
|
||||
|
@ -131,5 +141,6 @@ $(() => {
|
|||
$cell.find('.theme-activities--item-label').on('click', evt => {
|
||||
$(evt.target).closest('.theme-activities--item').toggleClass('collapsed')
|
||||
})
|
||||
|
||||
})
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue