Add class to page based on topic category

This commit is contained in:
riking 2014-04-30 22:24:02 -07:00
parent 664d2016d0
commit 63ce01893b
2 changed files with 6 additions and 1 deletions

View File

@ -52,6 +52,10 @@ Discourse.Topic = Discourse.Model.extend({
return null;
}.property('category_id', 'categoryName'),
categoryClass: function() {
return 'category-' + Discourse.Category.slugFor(this.get('category'));
}.property('category'),
shareUrl: function(){
var user = Discourse.User.current();
return this.get('url') + (user ? '?u=' + user.get('username_lower') : '');

View File

@ -16,7 +16,8 @@ Discourse.TopicView = Discourse.View.extend(Discourse.Scrolling, {
classNameBindings: ['controller.multiSelect:multi-select',
'topic.archetype',
'topic.category.read_restricted:read_restricted',
'topic.deleted:deleted-topic'],
'topic.deleted:deleted-topic',
'topic.categoryClass'],
menuVisible: true,
SHORT_POST: 1200,