mirror of
https://github.com/discourse/discourse.git
synced 2025-03-20 09:55:36 +08:00
Adds a body class for static routes
This commit is contained in:
parent
c4cf057d07
commit
4cdd1e2e24
@ -4,6 +4,18 @@ import { on } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.View.extend(ScrollTop, {
|
||||
|
||||
@on('didInsertElement')
|
||||
_addBodyClass() {
|
||||
const path = this.get('controller.model.path');
|
||||
$('body').addClass(`static-${path}`);
|
||||
},
|
||||
|
||||
@on('willDestroyElement')
|
||||
_removeBodyClass() {
|
||||
const path = this.get('controller.model.path');
|
||||
$('body').removeClass(`static-${path}`);
|
||||
},
|
||||
|
||||
@on('didInsertElement')
|
||||
_checkRead() {
|
||||
const currentUser = this.get('controller.currentUser');
|
||||
|
Loading…
x
Reference in New Issue
Block a user