mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 12:43:52 +08:00
Change appearance of category label in discussion hero
This commit is contained in:
parent
9705497801
commit
9d6c5b9caa
2
extensions/tags/js/bootstrap.js
vendored
2
extensions/tags/js/bootstrap.js
vendored
|
@ -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';
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
.discussion-hero & {
|
||||
font-size: 14px;
|
||||
background: #fff;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
|
||||
.post-discussion-moved & {
|
||||
|
|
Loading…
Reference in New Issue
Block a user