Skip to content

Commit

Permalink
push chronology facet to URL parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Dec 21, 2024
1 parent e36d2ea commit f65db93
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions resources/js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,14 @@ $(document).on('change', '.facet-group input', function() {
updatePage(params);
})

/* checkbox for display of undated documents */
$(document).on("click", ".datefacet .label", function(event) {
$(".datefacets").find(".active").removeClass("active");
$(this).addClass("active");
const params = active_facets();
updatePage(params);
})

/* manage search filter checkboxes */
function checkAll(that) {
$(that).parents(".filterGroup").find(".btn-group :checkbox").prop('checked', true);
Expand Down Expand Up @@ -675,6 +683,7 @@ function active_facets() {
oldFromDate:'',
oldToDate:''*/
},

toString: function () {
return '?' + $.param($.extend({}, this.facets, this.sliderDates), true)
}
Expand All @@ -691,6 +700,8 @@ function active_facets() {
if(params.facets[facet] === undefined) { params.facets[facet] = [] }
params.facets[facet].push(value);
})
/* Get chronology facet value */
params.facets.chronology = $('.datefacets .active').attr('data-value');
/* Get date values from range slider */
if($('.rangeSlider:visible').length) {
slider = $('.rangeSlider:visible');
Expand Down

0 comments on commit f65db93

Please sign in to comment.