summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2019-03-23 15:58:46 +0100
committerDouwe Maan <douwe@selenight.nl>2019-03-26 14:37:15 +0100
commitf95838800f5dd48e7ab9079738c63e1a3523a3ba (patch)
tree95c8199d0504521fced9ace6a47433aafb959bea
parent38b69557e8446052f0ea7c71a9687f55781248e1 (diff)
downloadgitlab-ce-f95838800f5dd48e7ab9079738c63e1a3523a3ba.tar.gz
Add line type class to diff line num cells
-rw-r--r--app/assets/javascripts/notes/components/diff_with_note.vue4
-rw-r--r--app/views/projects/blob/preview.html.haml12
2 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/notes/components/diff_with_note.vue b/app/assets/javascripts/notes/components/diff_with_note.vue
index 9f9c7dc7dd6..ab758a9e922 100644
--- a/app/assets/javascripts/notes/components/diff_with_note.vue
+++ b/app/assets/javascripts/notes/components/diff_with_note.vue
@@ -81,8 +81,8 @@ export default {
:key="line.line_code"
class="line_holder"
>
- <td class="diff-line-num old_line">{{ line.old_line }}</td>
- <td class="diff-line-num new_line">{{ line.new_line }}</td>
+ <td :class="line.type" class="diff-line-num old_line">{{ line.old_line }}</td>
+ <td :class="line.type" class="diff-line-num new_line">{{ line.new_line }}</td>
<td :class="line.type" class="line_content" v-html="line.rich_text"></td>
</tr>
</template>
diff --git a/app/views/projects/blob/preview.html.haml b/app/views/projects/blob/preview.html.haml
index 365135e279e..3e893343165 100644
--- a/app/views/projects/blob/preview.html.haml
+++ b/app/views/projects/blob/preview.html.haml
@@ -7,14 +7,14 @@
- unless @diff_lines.empty?
%table.text-file.code.js-syntax-highlight
- @diff_lines.each do |line|
- %tr.line_holder{ class: "#{line.type}" }
+ %tr.line_holder{ class: line.type }
- if line.type == "match"
- %td.old_line.diff-line-num= "..."
- %td.new_line.diff-line-num= "..."
+ %td.old_line.diff-line-num.match= "..."
+ %td.new_line.diff-line-num.match= "..."
%td.line_content.match= line.text
- else
- %td.old_line.diff-line-num
- %td.new_line.diff-line-num
- %td.line_content{ class: "#{line.type}" }= diff_line_content(line.text)
+ %td.old_line.diff-line-num{ class: line.type }
+ %td.new_line.diff-line-num{ class: line.type }
+ %td.line_content{ class: line.type }= diff_line_content(line.text)
- else
.nothing-here-block No changes.