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) {
|
if (builder) {
|
||||||
const buttonAtts = builder(attrs, this.state, this.siteSettings);
|
const buttonAtts = builder(attrs, this.state, this.siteSettings);
|
||||||
if (buttonAtts) {
|
if (buttonAtts) {
|
||||||
const { position, beforeButton } = buttonAtts;
|
const { position, beforeButton, afterButton } = buttonAtts;
|
||||||
delete buttonAtts.position;
|
delete buttonAtts.position;
|
||||||
|
|
||||||
let button = this.attach(this.settings.buttonType, buttonAtts);
|
let button = this.attach(this.settings.buttonType, buttonAtts);
|
||||||
|
|
||||||
|
const content = [];
|
||||||
if (beforeButton) {
|
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) {
|
if (button) {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
|
|
|
@ -94,10 +94,6 @@
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
/* hide OP Solved plugin stuff */
|
|
||||||
.topic-after-cooked-outlet.solved-panel {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
/* localhost - MOOT for production */
|
/* localhost - MOOT for production */
|
||||||
.topic-category-outlet.show-topic-category-location,
|
.topic-category-outlet.show-topic-category-location,
|
||||||
div.alert.alert-info.alert-emails-disabled,
|
div.alert.alert-info.alert-emails-disabled,
|
||||||
|
|
Loading…
Reference in New Issue