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

Ctrl click should work #24

Closed
rnaud opened this issue Sep 13, 2011 · 1 comment
Closed

Ctrl click should work #24

rnaud opened this issue Sep 13, 2011 · 1 comment

Comments

@rnaud
Copy link

rnaud commented Sep 13, 2011

Hello,

As many of you I guess, I like to Ctrl+Click to open pages in another tab. Because of the click handler on remote link this does not work.

For now, I'm trying to edit the live("click.rails") function with this one :

$(rails.linkClickSelector).live('click.rails', function(e) {
var link = $(this);
if (!rails.allowAction(link)) return rails.stopEverything(e);

if (link.data('remote') !== undefined) {
  if (e.which == 2 || e.metaKey || e.ctrlKey){
    return true
  } else {
    rails.handleRemote(link);
    return false;
  }
} else if (link.data('method')) {
  rails.handleMethod(link);
  return false;
}

});

But I haven't tested it properly yet.
Any thoughts ?

@JangoSteve
Copy link
Member

Could you re-open this issue in jquery-ujs please?

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