grav-theme-libretic/templates/partials/simplesearch_searchbox.html.twig
Karol Orzeł 25ebdfcd7a Fixes #1
2015-02-18 18:03:05 +01:00

13 lines
516 B
Twig

<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>