mirror of
https://github.com/discourse/discourse.git
synced 2026-08-13 06:25:11 -05:00
FEATURE: add 'navigation-categories' class on 'body' when visiting /categories
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import UrlRefresh from 'discourse/mixins/url-refresh';
|
||||
import { on } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
const CATEGORIES_LIST_BODY_CLASS = "categories-list";
|
||||
|
||||
export default Ember.View.extend(UrlRefresh, {
|
||||
_addBodyClass: function() {
|
||||
$('body').addClass('categories-list');
|
||||
}.on('didInsertElement'),
|
||||
@on("didInsertElement")
|
||||
addBodyClass() {
|
||||
$('body').addClass(CATEGORIES_LIST_BODY_CLASS);
|
||||
},
|
||||
|
||||
_removeBodyClass: function() {
|
||||
$('body').removeClass('categories-list');
|
||||
}.on('willDestroyElement')
|
||||
@on("willDestroyElement")
|
||||
removeBodyClass() {
|
||||
$('body').removeClass(CATEGORIES_LIST_BODY_CLASS);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { on } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
const CATEGORIES_BODY_CLASS = "navigation-categories";
|
||||
|
||||
export default Ember.View.extend({
|
||||
@on("didInsertElement")
|
||||
addBodyClass() {
|
||||
$('body').addClass(CATEGORIES_BODY_CLASS);
|
||||
},
|
||||
|
||||
@on("willDestroyElement")
|
||||
removeBodyClass() {
|
||||
$('body').removeClass(CATEGORIES_BODY_CLASS);
|
||||
},
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import AddCategoryClass from 'discourse/mixins/add-category-class';
|
||||
|
||||
export default Em.View.extend(AddCategoryClass, {
|
||||
categoryFullSlug: Em.computed.alias('controller.category.fullSlug')
|
||||
export default Ember.View.extend(AddCategoryClass, {
|
||||
categoryFullSlug: Ember.computed.alias('controller.category.fullSlug')
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user