From 7df73c94a069925cd06f0f1376dfb80ef2d352f0 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 5 Oct 2017 14:34:27 -0400 Subject: [PATCH] Add a hook to decorate extra buttons --- app/assets/javascripts/discourse/widgets/post-menu.js.es6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 index 7dda8da45b3..2569ff04895 100644 --- a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 @@ -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)); }