diff --git a/app/assets/javascripts/discourse/views/discovery-categories.js.es6 b/app/assets/javascripts/discourse/views/discovery-categories.js.es6 index 59721af089c..ee4b13d7dce 100644 --- a/app/assets/javascripts/discourse/views/discovery-categories.js.es6 +++ b/app/assets/javascripts/discourse/views/discovery-categories.js.es6 @@ -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); + }, }); diff --git a/app/assets/javascripts/discourse/views/navigation-categories.js.es6 b/app/assets/javascripts/discourse/views/navigation-categories.js.es6 new file mode 100644 index 00000000000..dcd408de525 --- /dev/null +++ b/app/assets/javascripts/discourse/views/navigation-categories.js.es6 @@ -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); + }, +}); diff --git a/app/assets/javascripts/discourse/views/navigation-category.js.es6 b/app/assets/javascripts/discourse/views/navigation-category.js.es6 index f5e5c3d9701..6a871ecae3a 100644 --- a/app/assets/javascripts/discourse/views/navigation-category.js.es6 +++ b/app/assets/javascripts/discourse/views/navigation-category.js.es6 @@ -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') });