AmpersandJS / ampersand

Quickest way to get started with ampersand.
MIT License
812 stars 41 forks source link

global link click listener steals middle-clicks #86

Closed chesles closed 9 years ago

chesles commented 9 years ago

Related to a few other issues (#3, #71) - middle clicks are hijacked by the app by default when they should be opened in a new tab.

According to MDN a check for event.button == 0 would let us capture only left-click or "standard" clicks, allowing middle clicks to be handled by the browser. As of IE9 it looks like this convention is followed by all browsers (before that it was a bit of a mess, apparently).

lukekarrys commented 9 years ago

I create the module local-links to handle stuff like this and it is now being used in the template. I just tested in an ampersand app that uses local-links, and middle click now works as expected.