add unique body class to search and user pages

This commit is contained in:
Arpit Jalan 2016-09-19 00:12:09 +05:30
parent 48fb0558d8
commit 72f9369966
8 changed files with 36 additions and 2 deletions

View File

@ -0,0 +1,15 @@
import { on } from 'ember-addons/ember-computed-decorators';
export function createViewWithBodyClass(body_class) {
return Ember.View.extend({
@on("didInsertElement")
addBodyClass() {
$('body').addClass(body_class);
},
@on("willDestroyElement")
removeBodyClass() {
$('body').removeClass(body_class);
}
});
}

View File

@ -1,3 +1,5 @@
export default Ember.View.extend({
import { createViewWithBodyClass } from 'discourse/lib/create-view';
export default createViewWithBodyClass('search-page').extend({
classNames: ['search-container']
});

View File

@ -1,4 +1,6 @@
export default Ember.View.extend({
import { createViewWithBodyClass } from 'discourse/lib/create-view';
export default createViewWithBodyClass('user-preferences-page').extend({
templateName: 'user/preferences',
classNames: ['user-preferences']
});

View File

@ -0,0 +1,3 @@
import { createViewWithBodyClass } from 'discourse/lib/create-view';
export default createViewWithBodyClass('user-activity-page');

View File

@ -0,0 +1,3 @@
import { createViewWithBodyClass } from 'discourse/lib/create-view';
export default createViewWithBodyClass('user-invites-page');

View File

@ -0,0 +1,3 @@
import { createViewWithBodyClass } from 'discourse/lib/create-view';
export default createViewWithBodyClass('user-messages-page');

View File

@ -0,0 +1,3 @@
import { createViewWithBodyClass } from 'discourse/lib/create-view';
export default createViewWithBodyClass('user-notifications-page');

View File

@ -0,0 +1,3 @@
import { createViewWithBodyClass } from 'discourse/lib/create-view';
export default createViewWithBodyClass('user-summary-page');