Skip to content

Conversation

@MoonScript
Copy link
Contributor

  • Don't fire the ajax:send event if an ajax:beforeSend event-handler cancels the AJAX request (via return false). Currently, it's lying to us because you would still see an ajax:send event even if no request was made. This will make it honest by only firing ajax:send if a request was actually heading to the server.
  • Don't disable form elements until the ajax:send event fires. Currently, it disables form elements when the ajax:beforeSend event bubbles up to the document. So if you had your own document-level ajax:beforeSend event-handler that was bound after the one from jquery_ujs.js, your form elements would still get disabled, even if you cancelled the AJAX request by doing return false from your event-handler. This will wait to disable the form elements until we're sure that an AJAX request is actually being made, by hooking into the ajax:send event.

lucasmazza added a commit that referenced this pull request Mar 12, 2014
Don't fire ajax:send if ajax:beforeSend was cancelled. Don't disable form elements until ajax:send.
@lucasmazza lucasmazza merged commit 4f8fc46 into rails:master Mar 12, 2014
@MoonScript
Copy link
Contributor Author

Thanks @lucasmazza. Do you think you could also merge in 336? It's been out there for a while!

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

Successfully merging this pull request may close these issues.

2 participants