15 lines
525 B
Plaintext
15 lines
525 B
Plaintext
- if note.valid?
|
|
:plain
|
|
// hide and reset the form
|
|
var form = $("form[rel='#{note.discussion_id}']");
|
|
var row = form.closest("tr");
|
|
|
|
// 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
|
|
row.find(".notes").append("#{escape_javascript(render "notes/note", note: note)}");
|
|
}
|