Problem adding to post admin menu via plugin

I am stuck trying to update my plugin ( Bump Reset plugin - Annotated to help new devs ) to look right in the current version of Discourse.

The source file in question is here:

That the way it adds to the post admin menu is:

api.decorateWidget('post-admin-menu:after', resetBumpButtonDecorateCallback);

Where resetBumpButtonDecorateCallback defines the button attributes and then calls dec.attach.

This used to look correct, but now looks wrong.

The new button gets added as a <li>...</li> outside of the menu’s <ul>...</ul>:

The button functions OK when clicked, but obviously doesn’t look right.

Am I doing things the correct way, or is there a newer/better method for doing this?

Is there a way I can change my code so it adds the item inside the list instead of after it?

Many thanks for your time!

2 Likes