Browse Source

automatic search when language is selected

marc 8 years ago
parent
commit
a11230819f

+ 5
- 0
searx/static/plugins/js/search_on_category_select.js View File

@@ -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 View File

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