Created
July 17, 2012 19:01
-
-
Save glideranderson/3131295 to your computer and use it in GitHub Desktop.
Fat Free CRM Creat Comment js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if @comment.valid? | |
page.insert_html :after, :comment_new, :partial => "comment", :locals => { :comment => @comment } | |
page[dom_id(@comment)].visual_effect :highlight, :duration => 1.5 | |
end | |
page[:shown_notes].value = @comment.commentable.comment_ids.join(',') | |
page[:comment_comment].clear | |
page[:comment_comment].focus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id = dom_id(@comment) | |
if @comment.errors.empty? | |
page[id].replace :partial => "comment", :collection => [ @comment ] | |
page[id].visual_effect :highlight, :duration => 1.0 | |
else | |
page[id].replace_html :partial => "edit" | |
page[id].visual_effect :shake, :duration => 0.25, :distance => 6 | |
page[:comment_comment].focus | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment