mirror of
https://github.com/flarum/framework.git
synced 2025-06-20 17:21:21 +08:00
Don't color the hero if the tag doesn't have a color
This commit is contained in:
@ -27,8 +27,11 @@ export default function() {
|
|||||||
extend(DiscussionHero.prototype, 'view', function(view) {
|
extend(DiscussionHero.prototype, 'view', function(view) {
|
||||||
var tags = sortTags(this.props.discussion.tags());
|
var tags = sortTags(this.props.discussion.tags());
|
||||||
if (tags && tags.length) {
|
if (tags && tags.length) {
|
||||||
view.attrs.style = 'background-color: '+tags[0].color();
|
var color = tags[0].color();
|
||||||
view.attrs.className += ' discussion-hero-colored';
|
if (color) {
|
||||||
|
view.attrs.style = 'background-color: '+color;
|
||||||
|
view.attrs.className += ' discussion-hero-colored';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user