FEATURE: Calculate sprite-sheet based on currently active themes (#6973)

Previously there was only one sprite sheet, which always included icons from all themes even if they were disabled
This commit is contained in:
David Taylor
2019-02-06 15:51:23 +00:00
committed by GitHub
parent ba9cc83d4c
commit f3cfce4a93
8 changed files with 92 additions and 51 deletions

View File

@ -382,7 +382,7 @@ module ApplicationHelper
def theme_ids
if customization_disabled?
nil
[nil]
else
request.env[:resolved_theme_ids]
end
@ -454,11 +454,11 @@ module ApplicationHelper
asset_version: Discourse.assets_digest,
disable_custom_css: loading_admin?,
highlight_js_path: HighlightJs.path,
svg_sprite_path: SvgSprite.path,
svg_sprite_path: SvgSprite.path(theme_ids),
}
if Rails.env.development?
setup_data[:svg_icon_list] = SvgSprite.all_icons
setup_data[:svg_icon_list] = SvgSprite.all_icons(theme_ids)
end
if guardian.can_enable_safe_mode? && params["safe_mode"]