Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
814c2d3b
Commit
814c2d3b
authored
4 years ago
by
Martin Wortschack
Committed by
Phil Hughes
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace fa icons in single file diff
parent
87a0c544
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
app/assets/javascripts/single_file_diff.js
app/assets/javascripts/single_file_diff.js
+11
-7
app/views/projects/diffs/_file_header.html.haml
app/views/projects/diffs/_file_header.html.haml
+3
-1
changelogs/unreleased/mw-replace-fa-chevron-in-file-header-diff.yml
.../unreleased/mw-replace-fa-chevron-in-file-header-diff.yml
+5
-0
No files found.
app/assets/javascripts/single_file_diff.js
View file @
814c2d3b
...
...
@@ -23,7 +23,8 @@ export default class SingleFileDiff {
this
.
file
=
file
;
this
.
toggleDiff
=
this
.
toggleDiff
.
bind
(
this
);
this
.
content
=
$
(
'
.diff-content
'
,
this
.
file
);
this
.
$toggleIcon
=
$
(
'
.diff-toggle-caret
'
,
this
.
file
);
this
.
$chevronRightIcon
=
$
(
'
.diff-toggle-caret .chevron-right
'
,
this
.
file
);
this
.
$chevronDownIcon
=
$
(
'
.diff-toggle-caret .chevron-down
'
,
this
.
file
);
this
.
diffForPath
=
this
.
content
.
find
(
'
[data-diff-for-path]
'
).
data
(
'
diffForPath
'
);
this
.
isOpen
=
!
this
.
diffForPath
;
if
(
this
.
diffForPath
)
{
...
...
@@ -34,13 +35,13 @@ export default class SingleFileDiff {
.
hide
();
this
.
content
=
null
;
this
.
collapsedContent
.
after
(
this
.
loadingContent
);
this
.
$
toggleIcon
.
addClass
(
'
fa-caret-right
'
);
this
.
$
chevronRightIcon
.
removeClass
(
'
gl-display-none
'
);
}
else
{
this
.
collapsedContent
=
$
(
WRAPPER
)
.
html
(
COLLAPSED_HTML
)
.
hide
();
this
.
content
.
after
(
this
.
collapsedContent
);
this
.
$
toggleIcon
.
addClass
(
'
fa-caret-down
'
);
this
.
$
chevronDownIcon
.
removeClass
(
'
gl-display-none
'
);
}
$
(
'
.js-file-title, .click-to-expand
'
,
this
.
file
).
on
(
'
click
'
,
e
=>
{
...
...
@@ -52,20 +53,23 @@ export default class SingleFileDiff {
if
(
!
$target
.
hasClass
(
'
js-file-title
'
)
&&
!
$target
.
hasClass
(
'
click-to-expand
'
)
&&
!
$target
.
hasClass
(
'
diff-toggle-caret
'
)
!
$target
.
closest
(
'
.diff-toggle-caret
'
).
length
>
0
)
return
;
this
.
isOpen
=
!
this
.
isOpen
;
if
(
!
this
.
isOpen
&&
!
this
.
hasError
)
{
this
.
content
.
hide
();
this
.
$toggleIcon
.
addClass
(
'
fa-caret-right
'
).
removeClass
(
'
fa-caret-down
'
);
this
.
$chevronRightIcon
.
removeClass
(
'
gl-display-none
'
);
this
.
$chevronDownIcon
.
addClass
(
'
gl-display-none
'
);
this
.
collapsedContent
.
show
();
}
else
if
(
this
.
content
)
{
this
.
collapsedContent
.
hide
();
this
.
content
.
show
();
this
.
$toggleIcon
.
addClass
(
'
fa-caret-down
'
).
removeClass
(
'
fa-caret-right
'
);
this
.
$chevronDownIcon
.
removeClass
(
'
gl-display-none
'
);
this
.
$chevronRightIcon
.
addClass
(
'
gl-display-none
'
);
}
else
{
this
.
$toggleIcon
.
addClass
(
'
fa-caret-down
'
).
removeClass
(
'
fa-caret-right
'
);
this
.
$chevronDownIcon
.
removeClass
(
'
gl-display-none
'
);
this
.
$chevronRightIcon
.
addClass
(
'
gl-display-none
'
);
return
this
.
getContentHTML
(
cb
);
}
}
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/diffs/_file_header.html.haml
View file @
814c2d3b
-
if
local_assigns
.
fetch
(
:show_toggle
,
true
)
%i
.fa.diff-toggle-caret.fa-fw
%span
.diff-toggle-caret
=
sprite_icon
(
'chevron-right'
,
css_class:
'chevron-right gl-display-none'
)
=
sprite_icon
(
'chevron-down'
,
css_class:
'chevron-down gl-display-none'
)
-
if
diff_file
.
submodule?
%span
...
...
This diff is collapsed.
Click to expand it.
changelogs/unreleased/mw-replace-fa-chevron-in-file-header-diff.yml
0 → 100644
View file @
814c2d3b
---
title
:
Replace fa icons in single file diff
merge_request
:
48136
author
:
type
:
changed
This diff is collapsed.
Click to expand it.
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