Reputation: 1618
Is it possible to remove all the toolbar buttons relating to a plugin without removing the plugin functionality?
I have tried using the removeButtons
config option, and the toolbar
config option as methods to remove, and they remove the button, but also seem to remove underlying plugin functionality.
As an example, with default configuration, I have a "bold" button, and I can highlight text and click "Bold", and it turns bold, or I can highlight text and press ctrl+B, and it turns bold. Is there a way to remove the bold button from the toolbar without disabling ctrl+B functionality?
A second example, I have the "justify" plugin. I want to enable users to paste from word and maintain justification, but I don't want users to be able to then edit the justification from within the plugin. If I remove all buttons, the text does not paste with justification, however, if I leave 1 of the 4 (left, centre, right, block), then it works as I want.
Alternatively, is there a way to put buttons in an "advanced"/"extra" drop down kind of thing, so that I can effectively hide all the buttons I don't want whilst maintaining the underlying functionality?
Upvotes: 3
Views: 317
Reputation: 1618
After some more searching of the docs & googling, I found an additional config setting:
config.allowedContent = true;
It appears to allow any content from any plugin that is loaded without needing the button. Even with config.toolbar= [];
(i.e. no buttons at all), pasting from Word works as expected, and keyboard shortcuts still work.
Upvotes: 3