summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2015-05-27 23:26:24 +0200
committerAdam Tauber <asciimoo@gmail.com>2015-05-27 23:26:24 +0200
commite19eeeefa0358d4f39b6708ac4bdb036f2c4e733 (patch)
tree376790a3c8a3284e8d02349432a81952e2521a99
parentf79f6713b0ce825d3b3faf93a61581bba74163b7 (diff)
downloadsearxng-e19eeeefa0358d4f39b6708ac4bdb036f2c4e733.tar.gz
searxng-e19eeeefa0358d4f39b6708ac4bdb036f2c4e733.zip
[fix] do not submit form if there is no search query - fixes #341
-rw-r--r--searx/static/js/search_on_category_select.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/static/js/search_on_category_select.js b/searx/static/js/search_on_category_select.js
index 990211690..5ecc2cdb9 100644
--- a/searx/static/js/search_on_category_select.js
+++ b/searx/static/js/search_on_category_select.js
@@ -7,7 +7,9 @@ $(document).ready(function() {
$('#categories label').removeClass('btn-primary').removeClass('active').addClass('btn-default');
$(this).removeClass('btn-default').addClass('btn-primary').addClass('active');
$($(this).children()[0]).prop('checked', 'checked');
- $('#search_form').submit();
+ if($('#q').val()) {
+ $('#search_form').submit();
+ }
return false;
});
}