alohaeditor / Aloha-Editor

Aloha Editor is a JavaScript content editing library
http://www.alohaeditor.org
Other
2.46k stars 535 forks source link

Is there a way to disable table settings? (rowheader for example) #1634

Open Jujaju opened 4 years ago

Jujaju commented 4 years ago

Hey!

Currently I would like to disable the coulmnheader and the rowheader option completly or (in best case) just allow the rowheader option only for the first row.

Does Aloha provide this in any way?

bernhardriegler commented 4 years ago

Not right now. However you can easily add this feature.

Add a check if config is set before the button is initialised here: https://github.com/alohaeditor/Aloha-Editor/blob/dev/src/plugins/common/table/lib/table-plugin.js#L895

if (this.settings.allowRowHeaders) {
...

The scope property is used, to determine on which selection a button is shown. This could also be retrieved from the config. https://github.com/alohaeditor/Aloha-Editor/blob/dev/src/plugins/common/table/lib/table-plugin.js#L898

Make sure to fallback to the current behaviour to not introduce a breaking change.

bernhardriegler commented 4 years ago

The currently available table plugin configuration can be found in the guides: https://www.alohaeditor.org/guides/plugin_table.html#configuration-settings