Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-07-25 00:39:04 +0300
committerStan Hu <stanhu@gmail.com>2015-07-25 00:39:04 +0300
commit71a8c780fff67a4d29c19cb43dc6d002d72ecbc1 (patch)
treea3be3d6b52ce1c0a6abca822c48125c3859998b5
parentbbbcc9657f60960fadae2d9bbd1a11b3a5319e1f (diff)
parentd51ebb7e86bf294e3dd7be94d3c7ec94613a6120 (diff)
Merge branch 'master' of github.com:gitlabhq/gitlabhq
-rw-r--r--app/assets/javascripts/diff.js.coffee4
-rw-r--r--app/views/projects/blob/diff.html.haml2
-rw-r--r--lib/unfold_form.rb1
3 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/diff.js.coffee b/app/assets/javascripts/diff.js.coffee
index 069f91c30e1..6d9b364cb8d 100644
--- a/app/assets/javascripts/diff.js.coffee
+++ b/app/assets/javascripts/diff.js.coffee
@@ -31,6 +31,10 @@ class @Diff
bottom: unfoldBottom
offset: offset
unfold: unfold
+ # indent is used to compensate for single space indent to fit
+ # '+' and '-' prepended to diff lines,
+ # see https://gitlab.com/gitlab-org/gitlab-ce/issues/707
+ indent: 1
$.get(link, params, (response) =>
target.parent().replaceWith(response)
diff --git a/app/views/projects/blob/diff.html.haml b/app/views/projects/blob/diff.html.haml
index 84742608986..f3b01ff3288 100644
--- a/app/views/projects/blob/diff.html.haml
+++ b/app/views/projects/blob/diff.html.haml
@@ -11,7 +11,7 @@
%td.old_line.diff-line-num{data: {linenumber: line_old}}
= link_to raw(line_old), "#"
%td.new_line= link_to raw(line_new) , "#"
- %td.line_content.noteable_line= line
+ %td.line_content.noteable_line= ' ' * @form.indent + line
- if @form.unfold? && @form.bottom? && @form.to < @blob.loc
%tr.line_holder{ id: @form.to }
diff --git a/lib/unfold_form.rb b/lib/unfold_form.rb
index 46b12beeaaf..fcd01503d1b 100644
--- a/lib/unfold_form.rb
+++ b/lib/unfold_form.rb
@@ -8,4 +8,5 @@ class UnfoldForm
attribute :bottom, Boolean
attribute :unfold, Boolean, default: true
attribute :offset, Integer
+ attribute :indent, Integer, default: 0
end