Change Element Level
What it does
With this module you can create a basic handling of the element levels, e.g. for indenting and outdenting headings and chapters.
Installation
First you have to switch into your project location using the command line.
cd path/to/your/project
Then you can install the plugin as follows:
npm install @xeditor/plugin-changeelementlevel --save --registry https://npm.xeditor.com:4873
Configuration
The demo configuration of the plugin looks like this:
{
pluginId: 'changeelementlevel',
ptype: 'uxxeditorchangeelementlevel',
enableContextMenu: true,
elements: [{
moveElementType: 'chapter',
checkElementType: 'heading'
}]
}
This configuration results in the following:
- when a heading element is selected, the indent and outdent button will be enabled (if possible, outdent action is not enabled if selected element is already on first level)
- as enableContextMenu config is set to true, corresponding entries will be added to the context menu
- triggering the acton will indent/outdent the chapter element selected heading belongs to
- The plugin also adds additional button templates, which can be used in your toolbar configuration.
API
The API can be found here