summaryrefslogtreecommitdiff
path: root/searx/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'searx/static/js')
-rw-r--r--searx/static/js/search_on_category_select.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/static/js/search_on_category_select.js b/searx/static/js/search_on_category_select.js
index 6156ca4e8..5ecc2cdb9 100644
--- a/searx/static/js/search_on_category_select.js
+++ b/searx/static/js/search_on_category_select.js
@@ -1,5 +1,5 @@
$(document).ready(function() {
- if($('#q')) {
+ if($('#q').length) {
$('#categories label').click(function(e) {
$('#categories input[type="checkbox"]').each(function(i, checkbox) {
$(checkbox).prop('checked', false);
@@ -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;
});
}