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