summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-08-01 12:12:53 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-08-01 12:12:53 +0000
commit8c6b85eca5e19ca676eaef156876614526176821 (patch)
tree057ca696e8dbfa9ea31a273d3532a92bc0be783f
parente570b823c17ad405914b7b37e4df85c21edda2d1 (diff)
parent44eec823fb68238705eb932dd14aa211b730a316 (diff)
downloadgitlab-ce-8c6b85eca5e19ca676eaef156876614526176821.tar.gz
Merge branch '14202-avoid-line-code-position-calculations' into 'master'
Avoid line_code and position calculation on line partial for plain view See merge request !5591
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/projects/diffs/_line.html.haml7
2 files changed, 4 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c9658e4ba5c..387006eec4e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -34,6 +34,7 @@ v 8.11.0 (unreleased)
- Add the `sprockets-es6` gem
- Multiple trigger variables show in separate lines (Katarzyna Kobierska Ula Budziszewska)
- Profile requests when a header is passed
+ - Avoid calculation of line_code and position for _line partial when showing diff notes on discussion tab.
- Add commit stats in commit api. !5517 (dixpac)
- Make error pages responsive (Takuya Noguchi)
- Change requests_profiles resource constraint to catch virtually any file
diff --git a/app/views/projects/diffs/_line.html.haml b/app/views/projects/diffs/_line.html.haml
index 5a8a131d10c..4d3af905b58 100644
--- a/app/views/projects/diffs/_line.html.haml
+++ b/app/views/projects/diffs/_line.html.haml
@@ -1,8 +1,7 @@
- plain = local_assigns.fetch(:plain, false)
-- line_code = diff_file.line_code(line)
-- position = diff_file.position(line)
- type = line.type
-%tr.line_holder{ id: line_code, class: type }
+- line_code = diff_file.line_code(line) unless plain
+%tr.line_holder{ plain ? { class: type} : { class: type, id: line_code } }
- case type
- when 'match'
= render "projects/diffs/match_line", { line: line.text,
@@ -24,4 +23,4 @@
= link_text
- else
%a{href: "##{line_code}", data: { linenumber: link_text }}
- %td.line_content.noteable_line{ class: type, data: (diff_view_line_data(line_code, position, type) unless plain) }= diff_line_content(line.text, type)
+ %td.line_content.noteable_line{ class: type, data: (diff_view_line_data(line_code, diff_file.position(line), type) unless plain) }= diff_line_content(line.text, type)