2014-03-04 00:18:10 +04:00
|
|
|
// mixin used for routes that need to set a css className on the body tag
|
|
|
|
|
|
|
|
var styleBody = Ember.Mixin.create({
|
|
|
|
activate: function () {
|
2014-06-19 23:44:44 +04:00
|
|
|
this._super();
|
2014-03-04 00:18:10 +04:00
|
|
|
var cssClasses = this.get('classNames');
|
|
|
|
|
|
|
|
if (cssClasses) {
|
|
|
|
Ember.run.schedule('afterRender', null, function () {
|
|
|
|
cssClasses.forEach(function (curClass) {
|
|
|
|
Ember.$('body').addClass(curClass);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
deactivate: function () {
|
2014-06-19 23:44:44 +04:00
|
|
|
this._super();
|
2014-03-04 00:18:10 +04:00
|
|
|
var cssClasses = this.get('classNames');
|
|
|
|
|
|
|
|
Ember.run.schedule('afterRender', null, function () {
|
|
|
|
cssClasses.forEach(function (curClass) {
|
|
|
|
Ember.$('body').removeClass(curClass);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default styleBody;
|