mirror of
https://github.com/alvierahman90/gronk.git
synced 2024-11-25 00:29:51 +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 => {
|
searchBar.addEventListener('keyup', e => {
|
||||||
|
console.log(e)
|
||||||
// if user pressed enter
|
// if user pressed enter
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
|
if (e.shiftKey) {
|
||||||
|
window.open(results[0].item.path, '_blank')
|
||||||
|
} else {
|
||||||
window.location.href = results[0].item.path
|
window.location.href = results[0].item.path
|
||||||
}
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
updateResults()
|
updateResults()
|
||||||
})
|
})
|
||||||
searchBar.addEventListener('change', updateResults)
|
searchBar.addEventListener('change', updateResults)
|
||||||
|
Loading…
Reference in New Issue
Block a user