mirror of
https://github.com/thangisme/notes.git
synced 2024-12-22 15:56:32 -05:00
js fixes
This commit is contained in:
parent
6f225b0d28
commit
48a4a37977
@ -108,8 +108,10 @@ function initSearch() {
|
||||
}
|
||||
} else {
|
||||
var next = document.querySelector('.search-result');
|
||||
if (next) {
|
||||
next.classList.add('active');
|
||||
}
|
||||
}
|
||||
return;
|
||||
case 13: // enter
|
||||
e.preventDefault();
|
||||
@ -118,8 +120,10 @@ function initSearch() {
|
||||
active.click();
|
||||
} else {
|
||||
var first = document.querySelector('.search-result');
|
||||
if (first) {
|
||||
first.click();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
@ -247,7 +251,9 @@ function initSearch() {
|
||||
}
|
||||
});
|
||||
|
||||
addEvent(searchInput, 'blur', hideResults);
|
||||
addEvent(searchInput, 'blur', function(){
|
||||
setTimeout(function(){ hideResults() }, 300);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user