Skip to content

Commit

Permalink
Fixed form submit handler to only do remote-related things to remote …
Browse files Browse the repository at this point in the history
…forms.

Signed-off-by: Neeraj Singh <neerajdotname@gmail.com>
  • Loading branch information
JangoSteve authored and Neeraj Singh committed Apr 20, 2011
1 parent 5cc76cf commit 078d4fe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/rails.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@
return !remote;
}

if (nonBlankFileInputs) {
return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
}
if (remote) {
if (nonBlankFileInputs) {
return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
}

// If browser does not support submit bubbling, then this live-binding will be called before direct
// bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
if (!$.support.submitBubbles && rails.callFormSubmitBindings(form) === false) return rails.stopEverything(e);
// If browser does not support submit bubbling, then this live-binding will be called before direct
// bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
if (!$.support.submitBubbles && rails.callFormSubmitBindings(form) === false) return rails.stopEverything(e);

if (remote) {
rails.handleRemote(form);
return false;
} else {
Expand Down

0 comments on commit 078d4fe

Please sign in to comment.