summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone <annabel.dunstone@gmail.com>2016-04-13 12:54:21 -0500
committerAnnabel Dunstone <annabel.dunstone@gmail.com>2016-04-14 09:10:40 -0500
commitd176f873e1fdf23ebeeebf6d2d25927941016390 (patch)
tree3cd60e40d99235f6689cae652456a18b4486f03b
parent7030ffb0e09dbcc0d03d377846a04fe6cf7d20b6 (diff)
downloadgitlab-ce-d176f873e1fdf23ebeeebf6d2d25927941016390.tar.gz
Add content attributes to discussion diffs; change styling of add-note icon to prevent white spaces in paste
-rw-r--r--app/assets/stylesheets/pages/diff.scss26
-rw-r--r--app/assets/stylesheets/pages/notes.scss10
-rw-r--r--app/views/projects/blob/diff.html.haml4
-rw-r--r--app/views/projects/notes/discussions/_diff.html.haml6
4 files changed, 24 insertions, 22 deletions
diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss
index ca7fa2094b6..bd7640db3b7 100644
--- a/app/assets/stylesheets/pages/diff.scss
+++ b/app/assets/stylesheets/pages/diff.scss
@@ -69,10 +69,12 @@
&.noteable_line.old:before {
content: '-';
+ position: absolute;
}
&.noteable_line.new:before {
content: '+';
+ position: absolute;
}
span {
@@ -400,14 +402,22 @@
}
}
-.diff-line-num:not(.js-unfold-bottom) {
- a {
- &:before {
- content: attr(data-linenumber);
+.file-holder {
+ .diff-line-num:not(.js-unfold-bottom) {
+ a {
+ &:before {
+ content: attr(data-linenumber);
+ }
+ }
+ }
+}
+
+.discussion {
+ .diff-content {
+ .diff-line-num {
+ &:before {
+ content: attr(data-linenumber);
+ }
}
- -moz-user-select: none;
- -webkit-user-select: none;
- -ms-user-select: none;
- user-select: none;
}
}
diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss
index e421a31549a..ce44f5aa13b 100644
--- a/app/assets/stylesheets/pages/notes.scss
+++ b/app/assets/stylesheets/pages/notes.scss
@@ -276,8 +276,7 @@ ul.notes {
.diff-file tr.line_holder {
@mixin show-add-diff-note {
- filter: alpha(opacity=100);
- opacity: 1.0;
+ display: inline-block;
}
.add-diff-note {
@@ -291,13 +290,8 @@ ul.notes {
position: absolute;
z-index: 10;
width: 32px;
-
- transition: all 0.2s ease;
-
// "hide" it by default
- opacity: 0.0;
- filter: alpha(opacity=0);
-
+ display: none;
&:hover {
background: $gl-info;
color: #fff;
diff --git a/app/views/projects/blob/diff.html.haml b/app/views/projects/blob/diff.html.haml
index ea6d4df7255..c6ed78aadf6 100644
--- a/app/views/projects/blob/diff.html.haml
+++ b/app/views/projects/blob/diff.html.haml
@@ -9,9 +9,9 @@
- line_old = line_new - @form.offset
%tr.line_holder
%td.old_line.diff-line-num{data: {linenumber: line_old}}
- / = link_to raw(line_old), "#"
+ = link_to raw(line_old), "#"
%td.new_line.diff-line-num{data: {linenumber: line_old}}
- / = link_to raw(line_new) , "#"
+ = link_to raw(line_new) , "#"
%td.line_content.noteable_line==#{' ' * @form.indent}#{line}
- if @form.unfold? && @form.bottom? && @form.to < @blob.loc
diff --git a/app/views/projects/notes/discussions/_diff.html.haml b/app/views/projects/notes/discussions/_diff.html.haml
index 820e31ccd61..6abfb3abc3b 100644
--- a/app/views/projects/notes/discussions/_diff.html.haml
+++ b/app/views/projects/notes/discussions/_diff.html.haml
@@ -20,10 +20,8 @@
%td.new_line.diff-line-num= "..."
%td.line_content.match= line.text
- else
- %td.old_line.diff-line-num
- = raw(type == "new" ? "&nbsp;" : line.old_pos)
- %td.new_line.diff-line-num
- = raw(type == "old" ? "&nbsp;" : line.new_pos)
+ %td.old_line.diff-line-num{data: {linenumber: raw(type == "new" ? "&nbsp;" : line.old_pos)}}
+ %td.new_line.diff-line-num{data: {linenumber: raw(type == "old" ? "&nbsp;" : line.new_pos)}}
%td.line_content{class: "noteable_line #{type} #{line_code}", line_code: line_code}= diff_line_content(line.text)
- if line_code == note.line_code