mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 08:51:05 +08:00
Add a plugin hook to specify a class on the body of the document
This commit is contained in:
@ -103,6 +103,12 @@ class Plugin::Instance
|
||||
end
|
||||
end
|
||||
|
||||
def add_body_class(class_name)
|
||||
reloadable_patch do |plugin|
|
||||
::ApplicationHelper.extra_body_classes << class_name if plugin.enabled?
|
||||
end
|
||||
end
|
||||
|
||||
# Extend a class but check that the plugin is enabled
|
||||
# for class methods use `add_class_method`
|
||||
def add_to_class(class_name, attr, &block)
|
||||
|
Reference in New Issue
Block a user