mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 15:03:44 +08:00
16 lines
351 B
JavaScript
16 lines
351 B
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Mixin.create({
|
|
activate: function() {
|
|
var cssClass = this.toCssClass();
|
|
Ember.$('body').addClass(cssClass);
|
|
},
|
|
|
|
deactivate: function() {
|
|
Ember.$('body').removeClass(this.toCssClass());
|
|
},
|
|
|
|
toCssClass: function() {
|
|
return this.routeName.replace(/\./g, '-').dasherize();
|
|
}
|
|
}); |