Skip to content

Commit f65db93

Browse files
committed
push chronology facet to URL parameters
1 parent e36d2ea commit f65db93

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

resources/js/init.js

+11
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,14 @@ $(document).on('change', '.facet-group input', function() {
593593
updatePage(params);
594594
})
595595

596+
/* checkbox for display of undated documents */
597+
$(document).on("click", ".datefacet .label", function(event) {
598+
$(".datefacets").find(".active").removeClass("active");
599+
$(this).addClass("active");
600+
const params = active_facets();
601+
updatePage(params);
602+
})
603+
596604
/* manage search filter checkboxes */
597605
function checkAll(that) {
598606
$(that).parents(".filterGroup").find(".btn-group :checkbox").prop('checked', true);
@@ -675,6 +683,7 @@ function active_facets() {
675683
oldFromDate:'',
676684
oldToDate:''*/
677685
},
686+
678687
toString: function () {
679688
return '?' + $.param($.extend({}, this.facets, this.sliderDates), true)
680689
}
@@ -691,6 +700,8 @@ function active_facets() {
691700
if(params.facets[facet] === undefined) { params.facets[facet] = [] }
692701
params.facets[facet].push(value);
693702
})
703+
/* Get chronology facet value */
704+
params.facets.chronology = $('.datefacets .active').attr('data-value');
694705
/* Get date values from range slider */
695706
if($('.rangeSlider:visible').length) {
696707
slider = $('.rangeSlider:visible');

0 commit comments

Comments
 (0)