mirror of
https://github.com/discourse/discourse.git
synced 2025-06-10 19:59:12 +08:00
Adds a body class for static routes
This commit is contained in:
@ -4,6 +4,18 @@ import { on } from 'ember-addons/ember-computed-decorators';
|
|||||||
|
|
||||||
export default Ember.View.extend(ScrollTop, {
|
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')
|
@on('didInsertElement')
|
||||||
_checkRead() {
|
_checkRead() {
|
||||||
const currentUser = this.get('controller.currentUser');
|
const currentUser = this.get('controller.currentUser');
|
||||||
|
Reference in New Issue
Block a user