mirror of
https://github.com/flarum/framework.git
synced 2025-01-10 04:53:53 +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();
|
||
|
}
|
||
|
});
|