api.addPostMenuButton with conditions

First of all, I apologize for my poor English.
I want to add “Show More…” button.
The post in the image below consists of 10 lines of text, but only 5 lines are displayed.

User can see the full text by clicking on ShowMore.

This button should be branched to give or not give a button depending on the height of the cooked part of each post or the number of lines.

I don’t know how to branch using api.addPostMenuButton, so currently even a small post with only one line like the following is given this button.

This is not very desirable to me.

I’m thinking that the conditional branch should be able to get the height of the COOKED or the number of lines (or characters).
I looked at the documentation, but I can’t find any options for api.addPostMenuButton.
Any help would be greatly appreciated.

1 Like