[fix] do not submit form if there is no search query - fixes #341

This commit is contained in:
Adam Tauber 2015-05-27 23:26:24 +02:00
parent f79f6713b0
commit e19eeeefa0
1 changed files with 3 additions and 1 deletions

View File

@ -7,7 +7,9 @@ $(document).ready(function() {
$('#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();
if($('#q').val()) {
$('#search_form').submit();
}
return false;
});
}