gitlabhq/app/views/notes/_create_diff_note.js.haml

15 lines
525 B
Plaintext
Raw Normal View History

- if note.valid?
:plain
// hide and reset the form
2012-11-20 17:46:55 +01:00
var form = $("form[rel='#{note.discussion_id}']");
var row = form.closest("tr");
2012-11-20 17:46:55 +01:00
// is this the first note?
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])}");
} else {
// instert new note before reply button
2012-11-20 17:46:55 +01:00
row.find(".notes").append("#{escape_javascript(render "notes/note", note: note)}");
}