Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2018-01-03 13:08:14 +0300
committerSean McGivern <sean@mcgivern.me.uk>2018-01-03 13:08:14 +0300
commit3a727aa6d4ab4cb45e93c85ec198aa8b63e8b826 (patch)
tree860b58529c0c432161ddf235263ced1ab01f49c2 /app/helpers/icons_helper.rb
parentfced41b1a9a92eefa96ae2f6727804759341ccda (diff)
Multi File Editor File icons
Diffstat (limited to 'app/helpers/icons_helper.rb')
-rw-r--r--app/helpers/icons_helper.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index c6a83f21ceb..c5522ff7a69 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -30,6 +30,13 @@ module IconsHelper
ActionController::Base.helpers.image_path('icons.svg', host: sprite_base_url)
end
+ def sprite_file_icons_path
+ # SVG Sprites currently don't work across domains, so in the case of a CDN
+ # we have to set the current path deliberately to prevent addition of asset_host
+ sprite_base_url = Gitlab.config.gitlab.url if ActionController::Base.asset_host
+ ActionController::Base.helpers.image_path('file_icons.svg', host: sprite_base_url)
+ end
+
def sprite_icon(icon_name, size: nil, css_class: nil)
css_classes = size ? "s#{size}" : ""
css_classes << " #{css_class}" unless css_class.blank?