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
fb413c66
Commit
fb413c66
authored
Jul 22, 2020
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use constant for default icon size
parent
dd346d94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
app/helpers/icons_helper.rb
app/helpers/icons_helper.rb
+4
-2
No files found.
app/helpers/icons_helper.rb
View file @
fb413c66
...
...
@@ -6,6 +6,8 @@ module IconsHelper
extend
self
include
FontAwesome
::
Rails
::
IconHelper
DEFAULT_ICON_SIZE
=
16
# Creates an icon tag given icon name(s) and possible icon modifiers.
#
# Right now this method simply delegates directly to `fa_icon` from the
...
...
@@ -21,7 +23,7 @@ module IconsHelper
options
.
include?
(
:base
)
?
fa_stacked_icon
(
names
,
options
)
:
fa_icon
(
names
,
options
)
end
def
custom_icon
(
icon_name
,
size:
16
)
def
custom_icon
(
icon_name
,
size:
DEFAULT_ICON_SIZE
)
# We can't simply do the below, because there are some .erb SVGs.
# File.read(Rails.root.join("app/views/shared/icons/_#{icon_name}.svg")).html_safe
render
"shared/icons/
#{
icon_name
}
.svg"
,
size:
size
...
...
@@ -115,7 +117,7 @@ module IconsHelper
'earth'
end
sprite_icon
(
name
,
size:
16
,
css_class:
'gl-vertical-align-text-bottom'
)
sprite_icon
(
name
,
size:
DEFAULT_ICON_SIZE
,
css_class:
'gl-vertical-align-text-bottom'
)
end
def
file_type_icon_class
(
type
,
mode
,
name
)
...
...
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