Change theme color based on tag color

This commit is contained in:
Franz Liedke 2015-06-27 19:13:21 +02:00
parent 7d38f0880e
commit b799e3bc69

View File

@ -12,13 +12,16 @@ export default function() {
}
};
var originalThemeColor = $('meta[name=theme-color]').attr('content');
// If currently viewing a tag, insert a tag hero at the top of the
// view.
// view and set the theme color accordingly.
extend(IndexPage.prototype, 'view', function(view) {
var tag = this.currentTag();
if (tag) {
view.children[0] = TagHero.component({tag});
}
$('meta[name=theme-color]').attr('content', tag ? tag.color() : originalThemeColor);
});
// If currently viewing a tag, restyle the 'new discussion' button to use