Skip to content

Commit

Permalink
Get rid of trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
foca committed Feb 6, 2010
1 parent a10ad7e commit 96e084b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/rails.js
Expand Up @@ -17,7 +17,7 @@ jQuery(function ($) {

return event.result !== false;
},

/**
* Handles execution of remote calls firing overridable events along the way
*/
Expand Down Expand Up @@ -72,35 +72,35 @@ jQuery(function ($) {
* remote handlers
*/
$('form[data-remote="true"]').live('submit', function (e) {
$(this).callRemote();
$(this).callRemote();
e.preventDefault();
});

$('a[data-remote="true"],input[data-remote="true"]').live('click', function (e) {
$(this).callRemote();
$(this).callRemote();
e.preventDefault();
});

$('a[data-method][data-remote!=true]').live('click',function(e){
$('a[data-method][data-remote!=true]').live('click',function(e){
var link = $(this),
href = link.attr('href'),
method = link.attr('data-method'),
form = $('<form method="post" action="'+href+'">'),
input = $('<input name="_method" value="'+method+'" type="hidden" />'),
csrf_input = $('<input name="'+csrf_param+'" value="'+csrf_token+'" type="hidden" />');

form.hide()
.append(input)
.append(csrf_input)
.appendTo('body'); // redundant?

e.preventDefault();
form.submit();
});

/**
* disable_with handlers
*/
*/
$('form[data-remote="true"]').live('ajax:before', function () {
$(this).children('input[data-disable-with]').each(function () {
var input = $(this);
Expand Down

0 comments on commit 96e084b

Please sign in to comment.