Commit 6c6f415cae54be4dae4522e901ed55c9dae04a15

Authored by Riyad Preukschas
1 parent 5c2f6d7f

Fix appending diff line notes

app/contexts/notes/create_context.rb
... ... @@ -3,8 +3,8 @@ module Notes
3 3 def execute
4 4 note = project.notes.new(params[:note])
5 5 note.author = current_user
6   - note.notify = true if params[:notify] == '1'
7   - note.notify_author = true if params[:notify_author] == '1'
  6 + note.notify = params[:notify].present?
  7 + note.notify_author = params[:notify_author].present?
8 8 note.save
9 9 note
10 10 end
... ...
app/views/notes/_create_per_line_note.js.haml
... ... @@ -6,7 +6,7 @@
6 6  
7 7 // find the reply button for this line
8 8 // (might not be there if this is the first note)
9   - var trRpl = $("a.line_note_reply_link[data-line-code='#{note.line_code}']").closest("tr");
  9 + var trRpl = $("a.line_note_reply_link[data-noteable-type='#{note.noteable_type}'][data-noteable-id='#{note.noteable_id}'][data-line-code='#{note.line_code}']").closest("tr");
10 10 if (trRpl.size() == 0) {
11 11 // find the commented line ...
12 12 var trEl = $(".#{note.line_code}").parent();
... ...