1
0
mirror of https://github.com/searxng/searxng.git synced 2024-09-17 18:50:16 +02:00
searxng/searx/static/plugins/js/search_on_category_select.js
2016-07-25 23:40:31 +02:00

20 lines
633 B
JavaScript

$(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();
}
});
}
});