diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-10-21 16:19:04 +0100 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-10-21 16:19:04 +0100 |
commit | 3176eb83b6da5a66d6a506c7967f434732ae6864 (patch) | |
tree | f28c95d169b0e360dcbf17fba9a3c772e057fa49 | |
parent | 9c3f094a2f7609386ed182e4d5f6f9e7f6938388 (diff) | |
download | gitlab-ce-3176eb83b6da5a66d6a506c7967f434732ae6864.tar.gz |
Added discussion_line_code value to note response and use it to query the right row for the discussion UI
-rw-r--r-- | app/assets/javascripts/notes.js | 3 | ||||
-rw-r--r-- | app/controllers/concerns/notes_actions.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 9c008da1a5d..cf247a4c170 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -414,7 +414,8 @@ export default class Notes { } this.note_ids.push(noteEntity.id); form = $form || $(`.js-discussion-note-form[data-discussion-id="${noteEntity.discussion_id}"]`); - row = form.closest('tr'); + + row = form.length ? form.closest('tr') : $(`#${noteEntity.discussion_line_code}`); if (noteEntity.on_image) { row = form; diff --git a/app/controllers/concerns/notes_actions.rb b/app/controllers/concerns/notes_actions.rb index 1126f706393..688bf16cfea 100644 --- a/app/controllers/concerns/notes_actions.rb +++ b/app/controllers/concerns/notes_actions.rb @@ -106,7 +106,8 @@ module NotesActions discussion_resolvable: discussion.resolvable?, diff_discussion_html: diff_discussion_html(discussion), - discussion_html: discussion_html(discussion) + discussion_html: discussion_html(discussion), + discussion_line_code: discussion.line_code, ) end end |