2012-02-24 21:36:44 +01:00
|
|
|
- if note.valid?
|
|
|
|
:plain
|
2012-09-14 01:32:55 +02:00
|
|
|
// 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-09-14 01:32:55 +02:00
|
|
|
|
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])}");
|
2012-09-14 01:32:55 +02:00
|
|
|
} 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)}");
|
2012-09-14 01:32:55 +02:00
|
|
|
}
|