mirror of
https://github.com/flarum/core.git
synced 2025-08-24 00:53:27 +02:00
Add class to IndexPage when viewing a tag
This commit is contained in:
8
extensions/tags/js/forum/dist/extension.js
vendored
8
extensions/tags/js/forum/dist/extension.js
vendored
@@ -150,6 +150,14 @@ System.register('flarum/tags/addTagFilter', ['flarum/extend', 'flarum/components
|
||||
return original();
|
||||
});
|
||||
|
||||
extend(IndexPage.prototype, 'view', function (vdom) {
|
||||
var tag = this.currentTag();
|
||||
|
||||
if (tag) {
|
||||
vdom.attrs.className += ' IndexPage--tag' + tag.id();
|
||||
}
|
||||
});
|
||||
|
||||
// If currently viewing a tag, restyle the 'new discussion' button to use
|
||||
// the tag's color.
|
||||
extend(IndexPage.prototype, 'sidebarItems', function (items) {
|
||||
|
@@ -20,6 +20,14 @@ export default function() {
|
||||
return original();
|
||||
});
|
||||
|
||||
extend(IndexPage.prototype, 'view', function(vdom) {
|
||||
const tag = this.currentTag();
|
||||
|
||||
if (tag) {
|
||||
vdom.attrs.className += ' IndexPage--tag'+tag.id();
|
||||
}
|
||||
});
|
||||
|
||||
// If currently viewing a tag, restyle the 'new discussion' button to use
|
||||
// the tag's color.
|
||||
extend(IndexPage.prototype, 'sidebarItems', function(items) {
|
||||
|
Reference in New Issue
Block a user