This plugin is only useful for developers, however, making it core allows us to centralize any component modification in one commit. This integration also adds a new site_setting: `styleguide_admin_only` which allows to enable a styleguide on a live site while restricting visibility to admins only. By default, styleguide is disabled.
19 lines
392 B
JavaScript
19 lines
392 B
JavaScript
import computed from "discourse-common/utils/decorators";
|
|
|
|
export default Ember.Component.extend({
|
|
tagName: "section",
|
|
classNameBindings: [":styleguide-section", "sectionClass"],
|
|
|
|
didReceiveAttrs() {
|
|
this._super(...arguments);
|
|
window.scrollTo(0, 0);
|
|
},
|
|
|
|
@computed("section")
|
|
sectionClass(section) {
|
|
if (section) {
|
|
return `${section.id}-examples`;
|
|
}
|
|
},
|
|
});
|