Sticky autocomplete
This commit is contained in:
parent
edeece9d7c
commit
42c1f0aedc
|
@ -18,6 +18,7 @@ $(document).ready(() => {
|
||||||
let searchBar = $('#search-bar');
|
let searchBar = $('#search-bar');
|
||||||
|
|
||||||
searchBar.autocomplete({
|
searchBar.autocomplete({
|
||||||
|
appendTo: '#search-form',
|
||||||
source: (request, response) => {
|
source: (request, response) => {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '/langs/polish/words?like=' + request.term + '&limit=20&offset=0',
|
url: '/langs/polish/words?like=' + request.term + '&limit=20&offset=0',
|
||||||
|
@ -31,10 +32,6 @@ $(document).ready(() => {
|
||||||
setTimeout(() => e.currentTarget.select(), 100);
|
setTimeout(() => e.currentTarget.select(), 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window).on('scroll', () => {
|
|
||||||
searchBar.autocomplete('close');
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#search-form').on('submit', (e) => {
|
$('#search-form').on('submit', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue