BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
500a3de7
Unverified
Commit
500a3de7
authored
Jan 08, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix changes dropdown ellipsis working across browsers
Closes #41561
parent
82e2d90b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
4 deletions
+25
-4
diff.scss
app/assets/stylesheets/pages/diff.scss
+1
-3
diff_helper.rb
app/helpers/diff_helper.rb
+8
-0
_stats.html.haml
app/views/projects/diffs/_stats.html.haml
+1
-1
changes-dropdown-ellipsis.yml
changelogs/unreleased/changes-dropdown-ellipsis.yml
+5
-0
diff_helper_spec.rb
spec/helpers/diff_helper_spec.rb
+10
-0
No files found.
app/assets/stylesheets/pages/diff.scss
View file @
500a3de7
...
@@ -651,15 +651,13 @@
...
@@ -651,15 +651,13 @@
min-width
:
0
;
min-width
:
0
;
}
}
.diff-changed-file-name
,
.diff-changed-file-name
{
.diff-changed-file-path
{
overflow
:
hidden
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
.diff-changed-file-path
{
.diff-changed-file-path
{
direction
:
rtl
;
color
:
$gl-text-color-tertiary
;
color
:
$gl-text-color-tertiary
;
}
}
...
...
app/helpers/diff_helper.rb
View file @
500a3de7
...
@@ -226,4 +226,12 @@ module DiffHelper
...
@@ -226,4 +226,12 @@ module DiffHelper
diffs
.
overflow?
diffs
.
overflow?
end
end
def
diff_file_path_text
(
diff_file
,
max:
60
)
path
=
diff_file
.
new_path
return
path
unless
path
.
size
>
max
&&
max
>
3
"...
#{
path
[
-
(
max
-
3
)
..-
1
]
}
"
end
end
end
app/views/projects/diffs/_stats.html.haml
View file @
500a3de7
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
=
sprite_icon
(
diff_file_changed_icon
(
diff_file
),
size:
16
,
css_class:
"
#{
diff_file_changed_icon_color
(
diff_file
)
}
diff-file-changed-icon append-right-8"
)
=
sprite_icon
(
diff_file_changed_icon
(
diff_file
),
size:
16
,
css_class:
"
#{
diff_file_changed_icon_color
(
diff_file
)
}
diff-file-changed-icon append-right-8"
)
%span
.diff-changed-file-content.append-right-8
%span
.diff-changed-file-content.append-right-8
%strong
.diff-changed-file-name
=
diff_file
.
blob
.
name
%strong
.diff-changed-file-name
=
diff_file
.
blob
.
name
%span
.diff-changed-file-path.prepend-top-5
=
diff_file
.
new_path
%span
.diff-changed-file-path.prepend-top-5
=
diff_file
_path_text
(
diff_file
)
%span
.diff-changed-stats
%span
.diff-changed-stats
%span
.cgreen
<
%span
.cgreen
<
+
#{
diff_file
.
added_lines
}
+
#{
diff_file
.
added_lines
}
...
...
changelogs/unreleased/changes-dropdown-ellipsis.yml
0 → 100644
View file @
500a3de7
---
title
:
Fixed chanages dropdown ellipsis positioning
merge_request
:
author
:
type
:
fixed
spec/helpers/diff_helper_spec.rb
View file @
500a3de7
...
@@ -266,4 +266,14 @@ describe DiffHelper do
...
@@ -266,4 +266,14 @@ describe DiffHelper do
end
end
end
end
end
end
context
'#diff_file_path_text'
do
it
'returns full path by default'
do
expect
(
diff_file_path_text
(
diff_file
)).
to
eq
(
diff_file
.
new_path
)
end
it
'returns truncated path'
do
expect
(
diff_file_path_text
(
diff_file
,
max:
10
)).
to
eq
(
"...open.rb"
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment