Hello,

I was wondering if was intentional for ajax links (link_to ... :remote
=> true ... )  to fire on any click. I want links to behave where a
left click fires of the ajax request, but a right click can allow you
to copy link location or open in a new tab, depending on your browser.
I found that in firefox, you get the context menu on a right click,
but the action fires off anyway, not waiting for the user to decide
what they want to do on the right click. Same behaviour for a middle
click, which in some browsers would normally open up a new tab.

I was able to modify rails.js around line 133 to test if this is a
left click before handling the event in the usual manner.

133   document.on("click", "a[data-remote]", function(event, element)
{
134     if (event.stopped)
return;
135     // If loop inserted for left click only behaviour
136     if (event.button == 0) {
137       handleRemote(element);
138       event.stop();
139     }
140   });

My main question is... is this going to hurt my site in any way? Also,
is this something worthy of submitting a ticket over (if so, where)
and if not, what was the idea behind making links fire off on any type
of click. Thanks a lot,

--
Matthew Smart

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to