Adds a block control button on headings to collapse and expand content below. Collapsed sections hide following blocks until the next heading of equal or higher level.
Select a heading, open the block control menu (after Add), and choose Toggle collapse to fold or unfold its section.
<script src="/assets/redactor/redactor.js"></script>
<script src="/assets/redactor/plugins/collapse/collapse.js"></script>
const app = Redactor('#entry', {
plugins: ['collapse']
});
string)
Redactor('#entry', {
plugins: ['collapse']
});
en: {
collapse: {
'toggle-collapse': 'Toggle collapse'
}
}
This plugin does not emit events.
Toggles collapse on the current heading block and closes the dropdown.
app.collapse.collapse();