mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 04:31:57 +08:00
Change theme color based on tag color
This commit is contained in:
parent
7d38f0880e
commit
b799e3bc69
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user