diff --git a/src/rails.js b/src/rails.js index 88eac6e..2995b0b 100644 --- a/src/rails.js +++ b/src/rails.js @@ -157,17 +157,19 @@ } document.on('click', 'a[data-confirm], a[data-remote], a[data-method]', function(event, link) { - if (!allowAction(link)) { - event.stop(); - return false; - } + if (Event.isLeftClick(event)) { + if (!allowAction(link)) { + event.stop(); + return false; + } - if (link.readAttribute('data-remote')) { - handleRemote(link); - event.stop(); - } else if (link.readAttribute('data-method')) { - handleMethod(link); - event.stop(); + if (link.readAttribute('data-remote')) { + handleRemote(link); + event.stop(); + } else if (link.readAttribute('data-method')) { + handleMethod(link); + event.stop(); + } } });