mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 18:12:21 +02:00
[enh] new plugin: search on category select (currently only in oscar theme)
TODO purge mootools from default/courgette and integrate jquery ++ this theme
This commit is contained in:
parent
dd84814b68
commit
973c97c85b
3 changed files with 23 additions and 1 deletions
14
searx/static/js/search_on_category_select.js
Normal file
14
searx/static/js/search_on_category_select.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
$(document).ready(function() {
|
||||
if($('#q')) {
|
||||
$('#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');
|
||||
$('#search_form').submit();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue