Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypassing event handler on "command + click" #687

Open
iplanwebsites opened this issue Nov 1, 2017 · 3 comments
Open

Bypassing event handler on "command + click" #687

iplanwebsites opened this issue Nov 1, 2017 · 3 comments

Comments

@iplanwebsites
Copy link

Users use the keyboard shortcut to open links in new tabs.
Pjax seems to break this browser behaviour.

@staabm
Copy link
Contributor

staabm commented Nov 2, 2017

Pjax on its own does not detect new windows. You should do this kind of check in your pjax integration code

@iplanwebsites
Copy link
Author

I'm afraid this isn't possible. Let me clarify the problem.
The click event handler assigned to my links need to be bypassed only when the command or ctrl is pressed on click.

if(e.ctrlKey || e.metaKey){
  //exit pjax, let the browser default behavior function (open the link in a new tab)
}

@iplanwebsites
Copy link
Author

Here's the fix. Tested on OSX, should work on PC too.
#688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants