Allow plugins to add panels to header more easily

This commit is contained in:
James Kiesel 2017-03-24 09:19:25 +13:00
parent 19ad1e2c2e
commit d073f582eb
1 changed files with 7 additions and 0 deletions

View File

@ -214,6 +214,8 @@ export default createWidget('header', {
panels.push(this.attach('user-menu'));
}
this.additionalPanels(attrs, state).map(function(panel) { panels.push(panel) })
const contents = [ this.attach('home-logo', { minimized: !!attrs.topic }),
h('div.panel.clearfix', panels) ];
@ -224,6 +226,11 @@ export default createWidget('header', {
return h('div.wrap', h('div.contents.clearfix', contents));
},
// override to allow plugins to append additional panels
additionalPanels(attrs, state) {
return []
},
updateHighlight() {
if (!this.state.searchVisible) {
const service = this.register.lookup('search-service:main');