From b9fcb2bcdf5aa7767e5c4631064577a93d6a016f Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Wed, 15 May 2019 22:48:23 +0300 Subject: [PATCH] DEV: Add before button hook in post-menu. (#7550) --- .../javascripts/discourse/widgets/post-menu.js.es6 | 10 ++++++++-- app/assets/stylesheets/common/printer-friendly.scss | 4 ---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 index b613806ea43..dea4763d591 100644 --- a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 +++ b/app/assets/javascripts/discourse/widgets/post-menu.js.es6 @@ -428,14 +428,20 @@ export default createWidget("post-menu", { if (builder) { const buttonAtts = builder(attrs, this.state, this.siteSettings); if (buttonAtts) { - const { position, beforeButton } = buttonAtts; + const { position, beforeButton, afterButton } = buttonAtts; delete buttonAtts.position; let button = this.attach(this.settings.buttonType, buttonAtts); + const content = []; if (beforeButton) { - button = h("span", [beforeButton(h), button]); + content.push(beforeButton(h)); } + content.push(button); + if (afterButton) { + content.push(afterButton(h)); + } + button = h("span", content); if (button) { switch (position) { diff --git a/app/assets/stylesheets/common/printer-friendly.scss b/app/assets/stylesheets/common/printer-friendly.scss index 38b13c29b1f..e3ae895760b 100644 --- a/app/assets/stylesheets/common/printer-friendly.scss +++ b/app/assets/stylesheets/common/printer-friendly.scss @@ -94,10 +94,6 @@ color: #ddd; font-weight: bold; } - /* hide OP Solved plugin stuff */ - .topic-after-cooked-outlet.solved-panel { - display: none; - } /* localhost - MOOT for production */ .topic-category-outlet.show-topic-category-location, div.alert.alert-info.alert-emails-disabled,