Skip to content

Commit

Permalink
Use event.button instead of event.which
Browse files Browse the repository at this point in the history
`event.which` is non-standard
  • Loading branch information
dieulot committed Feb 2, 2017
1 parent a156d9a commit 155536f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/instantclick.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,10 @@ var instantclick
return
}

if (event.which > 1 || event.metaKey || event.ctrlKey) { // Opening in new tab
/* Check if it's opening in a new tab */
if (event.button != 0 // Chrome < 55 fires a click event when the middle mouse button is pressed
|| event.metaKey
|| event.ctrlKey) {
return
}
event.preventDefault()
Expand Down

0 comments on commit 155536f

Please sign in to comment.