mirror of
https://github.com/discourse/discourse.git
synced 2025-02-13 15:12:46 +08:00
16 lines
449 B
JavaScript
16 lines
449 B
JavaScript
export default Ember.View.extend({
|
|
_appendCategoryClass: function(obj, key) {
|
|
var newClass = Em.get(obj, key);
|
|
if (newClass) {
|
|
$('body').addClass('category-' + newClass);
|
|
}
|
|
}.observes('controller.styleCategory.id'),
|
|
|
|
_removeOldClass: function(obj, key) {
|
|
var oldClass = Em.get(obj, key);
|
|
if (oldClass) {
|
|
$('body').removeClass('category-' + oldClass);
|
|
}
|
|
}.observesBefore('controller.styleCategory.id')
|
|
});
|