Bugfix/431 heading levels and config options #434
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When you define a CKEditor Config, the selected “Heading Levels” settings should be respected even if some of them are later not listed under the “Config Options”.
With the options that do not set the defaults when you drag the toolbar item (e.g. TableConfig), there is a default config that’s being applied even though you don’t see it under “Config Options”. If you want to add an option, you need to repeat the defaults and add to them. For example, the default table config will give you row, column and merge buttons:
If you want to add table properties to that list, you need to repeat the values from the last link and add
tablePropertieslike so:However, the heading options are a bit special as those are tied not only to the “Config Options” but also to the “Heading Levels” setting.
This PR ensures that when it comes to headings, the “Config Options” are only applied if the corresponding item is checked under the “Heading Levels”.
So, if you only selected “Heading 2” and “Heading 3” under “Heading Levels”, but under “Config Options”, you have the following:
only paragraph, heading2 and heading3 from the above JS will be used.
For clarity, I also removed the defaults listed here, so that if you have a config that doesn’t have the “Heading” toolbar item in it, and then you drag it in, you don’t see any defaults under “Config Options”.
Related issues
#431