mirror of
https://github.com/alvierahman90/gronk.git
synced 2024-11-28 18:09:53 +00:00
Open link article in new tab if user presses shift+enter
This commit is contained in:
parent
7654745cf0
commit
8871faaef0
@ -68,10 +68,16 @@ function updateResults() {
|
||||
}
|
||||
|
||||
searchBar.addEventListener('keyup', e => {
|
||||
console.log(e)
|
||||
// if user pressed enter
|
||||
if (e.keyCode === 13) {
|
||||
if (e.shiftKey) {
|
||||
window.open(results[0].item.path, '_blank')
|
||||
} else {
|
||||
window.location.href = results[0].item.path
|
||||
}
|
||||
return
|
||||
}
|
||||
updateResults()
|
||||
})
|
||||
searchBar.addEventListener('change', updateResults)
|
||||
|
Loading…
Reference in New Issue
Block a user