Browse Source

[fix] do not submit form if there is no search query - fixes #341

Adam Tauber 10 years ago
parent
commit
e19eeeefa0
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      searx/static/js/search_on_category_select.js

+ 3
- 1
searx/static/js/search_on_category_select.js View File

@@ -7,7 +7,9 @@ $(document).ready(function() {
7 7
             $('#categories label').removeClass('btn-primary').removeClass('active').addClass('btn-default');
8 8
             $(this).removeClass('btn-default').addClass('btn-primary').addClass('active');
9 9
             $($(this).children()[0]).prop('checked', 'checked');
10
-            $('#search_form').submit();
10
+            if($('#q').val()) {
11
+                $('#search_form').submit();
12
+            }
11 13
             return false;
12 14
         });
13 15
     }