gitlabhq/app/views/notes/_create_discussion_note.js.haml
2012-12-03 22:51:56 +01:00

14 lines
566 B
Plaintext

- if note.valid?
:plain
// is this the first note of discussion?
var row = $("form[rel='#{note.discussion_id}']").closest("tr");
if (row.is(".js-temp-notes-holder")) {
// insert the note and the reply button after it
row.after("#{escape_javascript(render "notes/diff_notes_with_reply", notes: [note])}");
// will be added again below
row.next().find(".note").remove();
}
// append new note to all discussions
$(".notes[rel='#{note.discussion_id}']").append("#{escape_javascript(render "notes/note", note: note)}");