diff options
author | Noémi Ványi <sitbackandwait@gmail.com> | 2020-06-16 23:00:46 +0200 |
---|---|---|
committer | Noémi Ványi <sitbackandwait@gmail.com> | 2020-06-18 23:06:09 +0200 |
commit | 4ec2fab583d567b7bee45507304dd405f1fef2b2 (patch) | |
tree | dc27af27cfa3dae97ba4d4209c4da5dd934b0f1c /searx | |
parent | 08c13daf85311aa1799b8ea9e0990fab058c2b7f (diff) | |
download | searxng-4ec2fab583d567b7bee45507304dd405f1fef2b2.tar.gz searxng-4ec2fab583d567b7bee45507304dd405f1fef2b2.zip |
Consider HTTP request when running search categories on select is enabled
Closes #1138
Diffstat (limited to 'searx')
-rw-r--r-- | searx/static/plugins/js/search_on_category_select.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/searx/static/plugins/js/search_on_category_select.js b/searx/static/plugins/js/search_on_category_select.js index 1c42d9e9e..d590ed127 100644 --- a/searx/static/plugins/js/search_on_category_select.js +++ b/searx/static/plugins/js/search_on_category_select.js @@ -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; +} |