Rename 'notes/create_*' partials
This commit is contained in:
parent
61eb650db0
commit
8fb70d924d
3 changed files with 2 additions and 2 deletions
19
app/views/notes/_create_per_line_note.js.haml
Normal file
19
app/views/notes/_create_per_line_note.js.haml
Normal file
|
@ -0,0 +1,19 @@
|
|||
- if note.valid?
|
||||
:plain
|
||||
// hide and reset the form
|
||||
$(".per_line_form").hide();
|
||||
$('.line-note-form-holder textarea').val("");
|
||||
|
||||
// find the reply button for this line
|
||||
// (might not be there if this is the first note)
|
||||
var trRpl = $("a.line_note_reply_link[data-line-code='#{note.line_code}']").closest("tr");
|
||||
if (trRpl.size() == 0) {
|
||||
// find the commented line ...
|
||||
var trEl = $(".#{note.line_code}").parent();
|
||||
// ... and insert the note and the reply button after it
|
||||
trEl.after("#{escape_javascript(render "notes/reply_button", line_code: note.line_code)}");
|
||||
trEl.after("#{escape_javascript(render "notes/per_line_show", note: note)}");
|
||||
} else {
|
||||
// instert new note before reply button
|
||||
trRpl.before("#{escape_javascript(render "notes/per_line_show", note: note)}");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue