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

This commit is contained in:
Bianca Nenciu 2019-05-15 22:48:23 +03:00 committed by GitHub
parent 0ef25f7a66
commit b9fcb2bcdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View File

@ -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) {

View File

@ -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,