mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 04:31:43 +08:00
DEV: Add before button hook in post-menu. (#7550)
This commit is contained in:
parent
0ef25f7a66
commit
b9fcb2bcdf
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user