Feature #880
[PATCH] Scribbish: use a helper instead of manually constructing the comment preview
| Status : | Assigned | Start : | ||
| Priority : | Low | Due date : | ||
| Assigned to : | neuro - | % Done : | 0% |
|
| Category : | frontend | |||
| Target version : | Maybe Someday | |||
| Resolution : |
Description
This patch updates Scribbish to use the submit_to_remote helper on the comments form in favour of manually constructing the AJAX call.
<%= submit_to_remote('preview', 'Preview!',
:update => 'preview',
:complete => "Element.show('preview')",
:url => { :action => 'comment_preview' }) %>
This patch also adds some js to the submit button to make comment submission less error-prone: the submit button is disabled after it's clicked, and the comment-preview area is hidden so that it doesn't show after a new comment is recieved:
<%= submit_tag 'Submit', :onclick => "this.disabled=true; Element.hide('preview');" %>