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)
|
||||||
|
Reference in New Issue
Block a user