瀏覽代碼

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

Adam Tauber 10 年之前
父節點
當前提交
e19eeeefa0
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. 3
    1
      searx/static/js/search_on_category_select.js

+ 3
- 1
searx/static/js/search_on_category_select.js 查看文件

@@ -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
     }