jquery-pjax icon indicating copy to clipboard operation
jquery-pjax copied to clipboard

Bypassing event handler on "command + click"

Open iplanwebsites opened this issue 8 years ago • 3 comments

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

iplanwebsites avatar Nov 01 '17 17:11 iplanwebsites

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

staabm avatar Nov 02 '17 10:11 staabm

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 avatar Nov 02 '17 19:11 iplanwebsites

Here's the fix. Tested on OSX, should work on PC too. https://github.com/defunkt/jquery-pjax/pull/688

iplanwebsites avatar Nov 02 '17 19:11 iplanwebsites