Change appearance of category label in discussion hero

This commit is contained in:
Toby Zerner 2015-05-11 10:35:01 +09:30
parent 9705497801
commit 9d6c5b9caa
3 changed files with 4 additions and 2 deletions

View File

@ -133,7 +133,7 @@ app.initializers.add('categories', function() {
extend(DiscussionHero.prototype, 'items', function(items) {
var category = this.props.discussion.category();
if (category) {
items.add('category', m('span.category-label', category.title()), {before: 'title'});
items.add('category', categoryLabel(category, {inverted: true}), {before: 'title'});
items.title.content.wrapperClass = 'block-item';
}
});

View File

@ -3,7 +3,7 @@ export default function categoryLabel(category, attrs) {
if (category) {
attrs.style = attrs.style || {};
attrs.style.backgroundColor = category.color();
attrs.style[attrs.inverted ? 'color' : 'backgroundColor'] = category.color();
} else {
attrs.className = (attrs.className || '')+' uncategorized';
}

View File

@ -19,6 +19,8 @@
.discussion-hero & {
font-size: 14px;
background: #fff;
padding: 2px 6px;
}
.post-discussion-moved & {