socialforge/app/views/words/create_reply.js.erb

27 lines
1.2 KiB
Plaintext

<% if @save_succ %>
<% if !@jfm.nil? && @jfm.jour_type == 'Principal' %>
$("#<%= @jfm.m_parent_id%>").children("div[nhname='reply_list']").prepend("<%= escape_javascript( render(:partial => 'users/user_jour_reply',:locals => {:reply=>@jfm} )) %>");
div_1 = $("#<%= @jfm.m_reply_id%>").children("div[nhname='div_form']");
div_1.hide();
div_2 = $("#<%= @jfm.m_reply_id%>").children("div[nhname='sub_div_form']");
div_2.hide();
<% else %>
var pre_append = $('<%= j(
render :partial => "words/journal_reply_items",
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name}
) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600);
var textarea = $('#project_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea.val('');
$('#project_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
var textarea1 = $('#course_respond_form_<%=@jfm.m_reply_id.to_s%> textarea');
textarea1.val('');
$('#course_respond_form_<%=@jfm.m_reply_id.to_s%>').hide();
setMaxLengthItem(pre_append.find('textarea')[0]);
<% end %>
<% else %>
alert("<%= l(:label_feedback_fail) %>");
<% end %>