Adding support for search plugin
This commit is contained in:
parent
eddffecf77
commit
8fbc870dd5
1 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,16 @@
|
|||
<form class="search-box">
|
||||
<input type="search">
|
||||
<input type="search" placeholder="Search..." value="{{ query }}" data-search-input="{{ base_url_relative }}{{ config.plugins.simplesearch.route}}/query" />
|
||||
<script>
|
||||
jQuery(document).ready(function($){
|
||||
var input = $('[data-search-input]');
|
||||
|
||||
input.on('keypress', function(event) {
|
||||
if (event.which == 13 && input.val().length > 3) {
|
||||
event.preventDefault();
|
||||
window.location.href = input.data('search-input') + ':' + input.val();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<i class="fa fa-search"></i>
|
||||
</form>
|
Loading…
Reference in a new issue