Newer
Older
dmpopidor / app / views / notes / create.js.erb

// rewrite the number of notes heading e.g. Notes(3)
<% noteslabel = "#notes_number_#{@question.id}" %>
$("<%=noteslabel%>").html("Comments (<%= @num_notes %>)");

dmproadmap.utils.tinymce.destroyEditorsByClassName('tinymce_notes');

// render the list of notes and invisible view and edit sections 
<% listlabel = "#comment-question-area-#{@question.id}" %>
$("<%=listlabel%>").html( 
    "<%= escape_javascript( render partial: '/phases/note', locals: {question: @question, answer: @answer, plan: @plan } ) %>"
);
dmproadmap.utils.tinymce.init({ selector: '.tinymce_notes'});