1
0
mirror of https://github.com/searxng/searxng.git synced 2024-09-13 08:40:16 +02:00
searxng/searx/static/plugins/js/search_on_category_select.js
2016-02-10 18:06:11 +01:00

17 lines
659 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);
});
$('#categories label').removeClass('btn-primary').removeClass('active').addClass('btn-default');
$(this).removeClass('btn-default').addClass('btn-primary').addClass('active');
$($(this).children()[0]).prop('checked', 'checked');
if($('#q').val()) {
$('#search_form').submit();
}
return false;
});
}
});