Fixes #1
This commit is contained in:
parent
5a4bcfbf95
commit
25ebdfcd7a
1 changed files with 13 additions and 0 deletions
13
templates/partials/simplesearch_searchbox.html.twig
Normal file
13
templates/partials/simplesearch_searchbox.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
<input type="text" placeholder="Search..." value="{{ query }}" data-searchsidebar-input="{{ base_url_relative }}{{ config.plugins.simplesearch.route}}/query" />
|
||||
<script>
|
||||
jQuery(document).ready(function($){
|
||||
var input = $('[data-searchsidebar-input]');
|
||||
|
||||
input.on('keypress', function(event) {
|
||||
if (event.which == 13 && input.val().length > 3) {
|
||||
event.preventDefault();
|
||||
window.location.href = input.data('searchsidebar-input') + ':' + input.val();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
Loading…
Reference in a new issue