mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 11:34:24 +03:00
49ea71ed4f
- Change fixture response of posts route to actual format. - Extracted classNames logic of routes into style-body mixin. - Additionally replaced all double-quotes with single-quotes for style conformance.
27 lines
763 B
JavaScript
27 lines
763 B
JavaScript
// mixin used for routes that need to set a css className on the body tag
|
|
|
|
var styleBody = Ember.Mixin.create({
|
|
activate: function () {
|
|
var cssClasses = this.get('classNames');
|
|
|
|
if (cssClasses) {
|
|
Ember.run.schedule('afterRender', null, function () {
|
|
cssClasses.forEach(function (curClass) {
|
|
Ember.$('body').addClass(curClass);
|
|
});
|
|
});
|
|
}
|
|
},
|
|
|
|
deactivate: function () {
|
|
var cssClasses = this.get('classNames');
|
|
|
|
Ember.run.schedule('afterRender', null, function () {
|
|
cssClasses.forEach(function (curClass) {
|
|
Ember.$('body').removeClass(curClass);
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
export default styleBody; |