瀏覽代碼

automatic search when language is selected

marc 8 年之前
父節點
當前提交
a11230819f
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 5
    0
      searx/static/plugins/js/search_on_category_select.js
  2. 1
    1
      searx/templates/oscar/languages.html

+ 5
- 0
searx/static/plugins/js/search_on_category_select.js 查看文件

@@ -15,5 +15,10 @@ $(document).ready(function() {
15 15
                 $('#search_form').submit();
16 16
             }
17 17
         });
18
+        $('#language').change(function(e) {
19
+            if($('#q').val()) {
20
+                $('#search_form').submit();
21
+            }
22
+        });
18 23
     }
19 24
 });

+ 1
- 1
searx/templates/oscar/languages.html 查看文件

@@ -1,7 +1,7 @@
1 1
 {% if preferences %}
2 2
 <select class="form-control" name='language'>
3 3
 {% else %}
4
-<select class="time_range" name='language'>
4
+<select class="time_range" id='language' name='language'>
5 5
 {% endif %}
6 6
 	<option value="all" {% if current_language == 'all' %}selected="selected"{% endif %}>{{ _('Default language') }}</option>
7 7
 		{% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %}