|
I want to add a custom button in "Brushes", next to the color picker, see screenshot. When a user clicks on that button, and the user has selected (marked) a text, the text background should be set to "transparent". I have seen example of adding a custom button, but not in "brushes". How do I do that? |
Answered by
xdan
Jun 26, 2026
Replies: 1 comment
|
Putting a button inside the brush dropdown means overriding the color-picker control, which is fiddly — but if you just want a one-click "transparent background", a separate toolbar button is easy. It runs the same command the brush uses: editor.execCommand('background', false, 'transparent');Register it through |
0 replies
Answer selected by
xdan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Putting a button inside the brush dropdown means overriding the color-picker control, which is fiddly — but if you just want a one-click "transparent background", a separate toolbar button is easy. It runs the same command the brush uses:
Register it through
controls/extraButtonswith thatexec, and it'll apply to the current selection. Want the full button snippet?