add unique body class to search and user pages
This commit is contained in:
parent
48fb0558d8
commit
72f9369966
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
|
@ -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']
|
||||
});
|
||||
|
|
|
@ -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']
|
||||
});
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
||||
|
||||
export default createViewWithBodyClass('user-activity-page');
|
|
@ -0,0 +1,3 @@
|
|||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
||||
|
||||
export default createViewWithBodyClass('user-invites-page');
|
|
@ -0,0 +1,3 @@
|
|||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
||||
|
||||
export default createViewWithBodyClass('user-messages-page');
|
|
@ -0,0 +1,3 @@
|
|||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
||||
|
||||
export default createViewWithBodyClass('user-notifications-page');
|
|
@ -0,0 +1,3 @@
|
|||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
||||
|
||||
export default createViewWithBodyClass('user-summary-page');
|
Loading…
Reference in New Issue