summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-10-21 16:19:04 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-10-21 16:19:04 +0100
commit3176eb83b6da5a66d6a506c7967f434732ae6864 (patch)
treef28c95d169b0e360dcbf17fba9a3c772e057fa49
parent9c3f094a2f7609386ed182e4d5f6f9e7f6938388 (diff)
downloadgitlab-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.js3
-rw-r--r--app/controllers/concerns/notes_actions.rb3
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