summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-08-18 19:54:50 -0500
committerDouwe Maan <douwe@selenight.nl>2016-08-18 20:49:25 -0500
commit10c5ec3e57d9a1a5a0477102dd7aa4cba0645b64 (patch)
tree5884a95e46379e72e84e15446192a1481968baa8
parent6a355d451eaca2fc10f5fcf31de13b05fa795b9b (diff)
downloadgitlab-ce-diff-line-comment-vuejs.tar.gz
Fix expansion of discussions in diffdiff-line-comment-vuejs
-rw-r--r--app/views/discussions/_diff_discussion.html.haml2
-rw-r--r--app/views/projects/diffs/_line.html.haml2
-rw-r--r--app/views/projects/diffs/_text_file.html.haml4
3 files changed, 3 insertions, 5 deletions
diff --git a/app/views/discussions/_diff_discussion.html.haml b/app/views/discussions/_diff_discussion.html.haml
index c280b5b53b7..1411daeb4a6 100644
--- a/app/views/discussions/_diff_discussion.html.haml
+++ b/app/views/discussions/_diff_discussion.html.haml
@@ -1,4 +1,4 @@
-- expanded = local_assigns.fetch(:expanded, discussion.expanded?)
+- expanded = local_assigns.fetch(:expanded, true)
%tr.notes_holder{class: ('hide' unless expanded)}
%td.notes_line{ colspan: 2 }
%td.notes_content
diff --git a/app/views/projects/diffs/_line.html.haml b/app/views/projects/diffs/_line.html.haml
index 4082f7bba20..7042e9f1fc9 100644
--- a/app/views/projects/diffs/_line.html.haml
+++ b/app/views/projects/diffs/_line.html.haml
@@ -30,8 +30,8 @@
= diff_line_content(line.text, type)
- discussions = local_assigns.fetch(:discussions, nil)
-- discussion_expanded = local_assigns.fetch(:discussion_expanded, false)
- if discussions && !line.meta?
- discussion = discussions[line_code]
- if discussion
+ - discussion_expanded = local_assigns.fetch(:discussion_expanded, discussion.expanded?)
= render "discussions/diff_discussion", discussion: discussion, expanded: discussion_expanded
diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml
index da8e343a121..f1d2d4bf268 100644
--- a/app/views/projects/diffs/_text_file.html.haml
+++ b/app/views/projects/diffs/_text_file.html.haml
@@ -9,9 +9,7 @@
= render partial: "projects/diffs/line",
collection: diff_file.highlighted_diff_lines,
as: :line,
- locals: { diff_file: diff_file,
- discussions: discussions,
- plain: true }
+ locals: { diff_file: diff_file, discussions: discussions }
- last_line = diff_file.highlighted_diff_lines.last.new_pos
- if !diff_file.new_file && last_line > 0