Commit 4ec2fab5 authored by Noémi Ványi's avatar Noémi Ványi

Consider HTTP request when running search categories on select is enabled

Closes #1138
parent 08c13daf
......@@ -6,19 +6,37 @@ $(document).ready(function() {
});
$(document.getElementById($(this).attr("for"))).prop('checked', true);
if($('#q').val()) {
if (getHttpRequest() == "GET") {
$('#search_form').attr('action', $('#search_form').serialize());
}
$('#search_form').submit();
}
return false;
});
$('#time-range').change(function(e) {
if($('#q').val()) {
if (getHttpRequest() == "GET") {
$('#search_form').attr('action', $('#search_form').serialize());
}
$('#search_form').submit();
}
});
$('#language').change(function(e) {
if($('#q').val()) {
if (getHttpRequest() == "GET") {
$('#search_form').attr('action', $('#search_form').serialize());
}
$('#search_form').submit();
}
});
}
});
function getHttpRequest() {
httpRequest = "POST";
urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('method')) {
httpRequest = urlParams.get('method');
}
return httpRequest;
}
Markdown is supported
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