mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FEATURE: add 'navigation-categories' class on 'body' when visiting /categories
This commit is contained in:
parent
3c2486e2ba
commit
5f33a81b1c
3 changed files with 28 additions and 8 deletions
|
@ -1,11 +1,16 @@
|
||||||
import UrlRefresh from 'discourse/mixins/url-refresh';
|
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, {
|
export default Ember.View.extend(UrlRefresh, {
|
||||||
_addBodyClass: function() {
|
@on("didInsertElement")
|
||||||
$('body').addClass('categories-list');
|
addBodyClass() {
|
||||||
}.on('didInsertElement'),
|
$('body').addClass(CATEGORIES_LIST_BODY_CLASS);
|
||||||
|
},
|
||||||
|
|
||||||
_removeBodyClass: function() {
|
@on("willDestroyElement")
|
||||||
$('body').removeClass('categories-list');
|
removeBodyClass() {
|
||||||
}.on('willDestroyElement')
|
$('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';
|
import AddCategoryClass from 'discourse/mixins/add-category-class';
|
||||||
|
|
||||||
export default Em.View.extend(AddCategoryClass, {
|
export default Ember.View.extend(AddCategoryClass, {
|
||||||
categoryFullSlug: Em.computed.alias('controller.category.fullSlug')
|
categoryFullSlug: Ember.computed.alias('controller.category.fullSlug')
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue