FIX: Support for extra admin links in the hamburger

This commit is contained in:
Robin Ward 2016-04-27 13:02:31 -04:00
parent 83c092af64
commit 43bbc425e8
No known key found for this signature in database
GPG key ID: 0E091E2B4ED1B83D

View file

@ -1,4 +1,4 @@
import { createWidget } from 'discourse/widgets/widget';
import { createWidget, applyDecorators } from 'discourse/widgets/widget';
import { h } from 'virtual-dom';
export default createWidget('hamburger-menu', {
@ -141,7 +141,10 @@ export default createWidget('hamburger-menu', {
}
if (currentUser && currentUser.staff) {
results.push(this.attach('menu-links', { contents: () => this.adminLinks() }));
results.push(this.attach('menu-links', { contents: () => {
const extraLinks = applyDecorators(this, 'admin-links', this.attrs, this.state) || [];
return this.adminLinks().concat(extraLinks);
}}));
}
results.push(this.attach('menu-links', { contents: () => this.generalLinks() }));