Commit db44e556 authored by Phil Hughes's avatar Phil Hughes

Visually display that expanded diff lines cant be commented on

Previously you just had to hover over a line to see if it could be
commented on, this changes that by changing the background color &
borders to show that the line cant have a comment.
parent 54f6357b
...@@ -155,6 +155,22 @@ $dark-il: #de935f; ...@@ -155,6 +155,22 @@ $dark-il: #de935f;
.line_content.match { .line_content.match {
@include dark-diff-match-line; @include dark-diff-match-line;
} }
&:not(.diff-expanded) + .diff-expanded,
&.diff-expanded + .line_holder:not(.diff-expanded) {
> .diff-line-num,
> .line_content {
border-top: 1px solid #000;
}
}
&.diff-expanded {
> .diff-line-num,
> .line_content {
background: #3e3e3e;
border-color: #3e3e3e;
}
}
} }
// highlight line via anchor // highlight line via anchor
......
...@@ -155,6 +155,22 @@ $monokai-gi: #a6e22e; ...@@ -155,6 +155,22 @@ $monokai-gi: #a6e22e;
.line_content.match { .line_content.match {
@include dark-diff-match-line; @include dark-diff-match-line;
} }
&:not(.diff-expanded) + .diff-expanded,
&.diff-expanded + .line_holder:not(.diff-expanded) {
> .diff-line-num,
> .line_content {
border-top: 1px solid #000;
}
}
&.diff-expanded {
> .diff-line-num,
> .line_content {
background: #3e3e3e;
border-color: #3e3e3e;
}
}
} }
// highlight line via anchor // highlight line via anchor
......
...@@ -159,6 +159,22 @@ $solarized-dark-il: #2aa198; ...@@ -159,6 +159,22 @@ $solarized-dark-il: #2aa198;
.line_content.match { .line_content.match {
@include dark-diff-match-line; @include dark-diff-match-line;
} }
&:not(.diff-expanded) + .diff-expanded,
&.diff-expanded + .line_holder:not(.diff-expanded) {
> .diff-line-num,
> .line_content {
border-top: 1px solid #000;
}
}
&.diff-expanded {
> .diff-line-num,
> .line_content {
background: #010d10;
border-color: #010d10;
}
}
} }
// highlight line via anchor // highlight line via anchor
......
...@@ -166,6 +166,22 @@ $solarized-light-il: #2aa198; ...@@ -166,6 +166,22 @@ $solarized-light-il: #2aa198;
.line_content.match { .line_content.match {
@include matchLine; @include matchLine;
} }
&:not(.diff-expanded) + .diff-expanded,
&.diff-expanded + .line_holder:not(.diff-expanded) {
> .diff-line-num,
> .line_content {
border-top: 1px solid #d2cdbd;
}
}
&.diff-expanded {
> .diff-line-num,
> .line_content {
background: #ece6d4;
border-color: #ece6d4;
}
}
} }
// highlight line via anchor // highlight line via anchor
......
...@@ -140,6 +140,22 @@ $white-gc-bg: #eaf2f5; ...@@ -140,6 +140,22 @@ $white-gc-bg: #eaf2f5;
} }
} }
&:not(.diff-expanded) + .diff-expanded,
&.diff-expanded + .line_holder:not(.diff-expanded) {
> .diff-line-num,
> .line_content {
border-top: 1px solid #e0e0e0;
}
}
&.diff-expanded {
> .diff-line-num,
> .line_content {
background: #f7f7f7;
border-color: #f7f7f7;
}
}
.line_content { .line_content {
&.old { &.old {
background-color: $line-removed; background-color: $line-removed;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
- line_old = line_new - @form.offset - line_old = line_new - @form.offset
- line_content = capture do - line_content = capture do
%td.line_content.noteable_line{ class: line_class }==#{' ' * @form.indent}#{line} %td.line_content.noteable_line{ class: line_class }==#{' ' * @form.indent}#{line}
%tr.line_holder{ id: line_old, class: line_class } %tr.line_holder.diff-expanded{ id: line_old, class: line_class }
- case diff_view - case diff_view
- when :inline - when :inline
%td.old_line.diff-line-num{ data: { linenumber: line_old } } %td.old_line.diff-line-num{ data: { linenumber: line_old } }
......
---
title: Visually show expanded diff lines cant have comments
merge_request:
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment