Add a hook to decorate extra buttons

This commit is contained in:
Robin Ward 2017-10-05 14:34:27 -04:00
parent beca02c046
commit 7df73c94a0
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import { createWidget } from 'discourse/widgets/widget';
import { applyDecorators, createWidget } from 'discourse/widgets/widget';
import { avatarAtts } from 'discourse/widgets/actions-summary';
import { h } from 'virtual-dom';
@ -340,7 +340,8 @@ export default createWidget('post-menu', {
postControls.push(repliesButton);
}
postControls.push(h('div.actions', visibleButtons));
let extraControls = applyDecorators(this, 'extra-controls', attrs, state);
postControls.push(h('div.actions', visibleButtons.concat(extraControls)));
if (state.adminVisible) {
postControls.push(this.attach('post-admin-menu', attrs));
}