diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index 9f5bceeef..1a92c79d2 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -2,7 +2,7 @@ <%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %> - +
<% id = 'project_respond_form_'+ reply.id.to_s %> <%= link_to reply.user.name, user_path(reply.user) %>:  <%= reply.notes %> @@ -10,10 +10,15 @@

<%= format_time reply.created_on %> - <%= toggle_link l(:label_projects_feedback_respond), id, {:focus => 'project_respond'} %> + + <%#= toggle_link l(:label_projects_feedback_respond), id, {:focus => 'project_respond'} %> + <%= link_to l(:label_projects_feedback_respond),'', + {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{reply.user.show_name}: '); return false;"} + %> +

- - +
diff --git a/app/views/words/_message.html.erb b/app/views/words/_message.html.erb index c3e97b360..2f8d5ecc2 100644 --- a/app/views/words/_message.html.erb +++ b/app/views/words/_message.html.erb @@ -55,7 +55,11 @@ ul.message-for-user li { <%= l :label_comment_time %>:  <%= format_time journal.created_on %> <% ids = 'project_respond_form_'+ journal.id.to_s%> - <%= toggle_link l(:label_projects_feedback_respond), ids, {:focus => 'project_respond'} %> + <%#= toggle_link l(:label_projects_feedback_respond), ids, {:focus => 'project_respond'} %> + + <%= link_to l(:label_projects_feedback_respond),'', + {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}:'); return false;"} + %>
style="display: none; width: 80%; margin: auto;"> diff --git a/public/javascripts/application.js b/public/javascripts/application.js index fea17ee12..65af8714e 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -590,6 +590,11 @@ function blockEventPropagation(event) { event.preventDefault(); } +function toggleAndSettingWordsVal(parent_widget, text_widget, value){ + text_widget.val(value) + parent_widget.toggle(400) +} + $(document).ready(setupAjaxIndicator); $(document).ready(hideOnLoad); $(document).ready(addFormObserversForDoubleSubmit);