1
0
mirror of https://github.com/thangisme/notes.git synced 2024-12-22 20:46:39 -05:00
This commit is contained in:
Silvio Giebl 2019-05-19 02:41:18 +02:00
parent 6f225b0d28
commit 48a4a37977

View File

@ -108,8 +108,10 @@ function initSearch() {
} }
} else { } else {
var next = document.querySelector('.search-result'); var next = document.querySelector('.search-result');
if (next) {
next.classList.add('active'); next.classList.add('active');
} }
}
return; return;
case 13: // enter case 13: // enter
e.preventDefault(); e.preventDefault();
@ -118,8 +120,10 @@ function initSearch() {
active.click(); active.click();
} else { } else {
var first = document.querySelector('.search-result'); var first = document.querySelector('.search-result');
if (first) {
first.click(); first.click();
} }
}
return; return;
} }
}); });
@ -247,7 +251,9 @@ function initSearch() {
} }
}); });
addEvent(searchInput, 'blur', hideResults); addEvent(searchInput, 'blur', function(){
setTimeout(function(){ hideResults() }, 300);
});
} }
} }