mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 19:52:01 +03:00
0f17378b26
Refs #4001 - grunt-jscs@0.8.1 which provides ES6 support.
32 lines
812 B
JavaScript
32 lines
812 B
JavaScript
// mixin used for routes that need to set a css className on the body tag
|
|
|
|
var styleBody = Ember.Mixin.create({
|
|
activate: function () {
|
|
this._super();
|
|
|
|
var cssClasses = this.get('classNames');
|
|
|
|
if (cssClasses) {
|
|
Ember.run.schedule('afterRender', null, function () {
|
|
cssClasses.forEach(function (curClass) {
|
|
Ember.$('body').addClass(curClass);
|
|
});
|
|
});
|
|
}
|
|
},
|
|
|
|
deactivate: function () {
|
|
this._super();
|
|
|
|
var cssClasses = this.get('classNames');
|
|
|
|
Ember.run.schedule('afterRender', null, function () {
|
|
cssClasses.forEach(function (curClass) {
|
|
Ember.$('body').removeClass(curClass);
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
export default styleBody;
|