mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FEATURE: backend support for user-selectable components
* FEATURE: backend support for user-selectable components * fix problems with previewing default theme * rename preview_key => preview_theme_id * omit default theme from child themes dropdown and try a different fix * cache & freeze stylesheets arrays
This commit is contained in:
@ -8,7 +8,10 @@ module Stylesheet
|
||||
end
|
||||
|
||||
def self.theme_id
|
||||
@theme_id || SiteSetting.default_theme_id
|
||||
if @theme_id.blank? && SiteSetting.default_theme_id != -1
|
||||
@theme_id = SiteSetting.default_theme_id
|
||||
end
|
||||
@theme_id
|
||||
end
|
||||
|
||||
def self.watch(paths = nil)
|
||||
@ -76,12 +79,8 @@ module Stylesheet
|
||||
Stylesheet::Manager.cache.clear
|
||||
|
||||
message = ["desktop", "mobile", "admin"].map do |name|
|
||||
{
|
||||
target: name,
|
||||
new_href: Stylesheet::Manager.stylesheet_href(name.to_sym),
|
||||
theme_id: Stylesheet::Watcher.theme_id
|
||||
}
|
||||
end
|
||||
Stylesheet::Manager.stylesheet_data(name.to_sym, Stylesheet::Watcher.theme_id)
|
||||
end.flatten
|
||||
MessageBus.publish '/file-change', message
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user