mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
UX: Apply changes live when editing currently active palette (#31874)
When editing a color palette via the new page introduced in https://github.com/discourse/discourse/pull/31742, it should apply the color changes for the admin making the change automatically upon save. Internal topic: t/148628/12.
This commit is contained in:
@ -674,14 +674,16 @@ module ApplicationHelper
|
||||
light_href,
|
||||
light_elements_media_query,
|
||||
"light-scheme",
|
||||
scheme_id,
|
||||
)
|
||||
result << color_scheme_stylesheet_link_tag(
|
||||
dark_href,
|
||||
dark_elements_media_query,
|
||||
"dark-scheme",
|
||||
dark_scheme_id,
|
||||
)
|
||||
else
|
||||
result << color_scheme_stylesheet_link_tag(light_href, "all", "light-scheme")
|
||||
result << color_scheme_stylesheet_link_tag(light_href, "all", "light-scheme", scheme_id)
|
||||
end
|
||||
result.html_safe
|
||||
end
|
||||
@ -857,7 +859,7 @@ module ApplicationHelper
|
||||
end
|
||||
end
|
||||
|
||||
def color_scheme_stylesheet_link_tag(href, media, css_class)
|
||||
%[<link href="#{href}" media="#{media}" rel="stylesheet" class="#{css_class}"/>]
|
||||
def color_scheme_stylesheet_link_tag(href, media, css_class, scheme_id)
|
||||
%[<link href="#{href}" media="#{media}" rel="stylesheet" class="#{css_class}"#{scheme_id && scheme_id != -1 ? %[ data-scheme-id="#{scheme_id}"] : ""}/>]
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user