mirror of
https://github.com/discourse/discourse.git
synced 2025-02-15 06:45:40 +08:00
16 lines
349 B
JavaScript
16 lines
349 B
JavaScript
import { on } from 'ember-addons/ember-computed-decorators';
|
|
|
|
export function createViewWithBodyClass(body_class) {
|
|
return Ember.View.extend({
|
|
@on("didInsertElement")
|
|
addBodyClass() {
|
|
$('body').addClass(body_class);
|
|
},
|
|
|
|
@on("willDestroyElement")
|
|
removeBodyClass() {
|
|
$('body').removeClass(body_class);
|
|
}
|
|
});
|
|
}
|