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