Skip to content

A platform for community discussion. Free, open, simple.

DEV: Add before button hook in post-menu. (#7550)

Bianca Nenciub9fcb2bcdf5a
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,