summaryrefslogtreecommitdiff
path: root/searx/static/plugins/js/search_on_category_select.js
blob: a76fd126674935ea98c3b5a5fd10ab78f6041e44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$(document).ready(function() {
    if($('#q').length) {
        $('#categories label').click(function(e) {
            $('#categories input[type="checkbox"]').each(function(i, checkbox) {
                $(checkbox).prop('checked', false);
            });
            $(document.getElementById($(this).attr("for"))).prop('checked', true);
            if($('#q').val()) {
                $('#search_form').submit();
            }
            return false;
        });
        $('#time-range > option').click(function(e) {
            if($('#q').val()) {
                $('#search_form').submit();
            }
        });
        $('#language').change(function(e) {
            if($('#q').val()) {
                $('#search_form').submit();
            }
        });
    }
});