DEV: allows to prepend widgets to post nav controls (#10005)

Co-authored-by: Régis Hanol <regis@hanol.fr>
This commit is contained in:
Joffrey JAFFEUX 2020-06-09 19:37:06 +02:00 committed by GitHub
parent 23ed16339f
commit a3cf1cf6ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 2 deletions

View File

@ -552,8 +552,17 @@ export default createWidget("post-menu", {
postControls.push(repliesButton); postControls.push(repliesButton);
} }
let extraControls = applyDecorators(this, "extra-controls", attrs, state); const extraControls = applyDecorators(this, "extra-controls", attrs, state);
postControls.push(h("div.actions", visibleButtons.concat(extraControls))); const beforeExtraControls = applyDecorators(
this,
"before-extra-controls",
attrs,
state
);
const controlsButtons = [...beforeExtraControls, ...visibleButtons, ...extraControls];
postControls.push(h("div.actions", controlsButtons));
if (state.adminVisible) { if (state.adminVisible) {
postControls.push(this.attach("post-admin-menu", attrs)); postControls.push(this.attach("post-admin-menu", attrs));
} }