mirror of
https://github.com/codex-team/editor.js
synced 2026-03-16 23:55:49 +01:00
Cleanup
This commit is contained in:
parent
c9defd949f
commit
ac69d085d5
1 changed files with 6 additions and 2 deletions
|
|
@ -672,7 +672,8 @@ export default class Block extends EventsDispatcher<BlockEvents> {
|
|||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Returns data to render in tunes menu.
|
||||
* Splits block tunes settings into 2 groups: popover items and custom html.
|
||||
*/
|
||||
public getTunes(): [TunesMenuEntry[], HTMLElement] {
|
||||
const tunesElement = document.createElement('div');
|
||||
|
|
@ -680,7 +681,10 @@ export default class Block extends EventsDispatcher<BlockEvents> {
|
|||
|
||||
const defaultTunesInstances = Array.from(this.defaultTunesInstances.values());
|
||||
const customTunesInstances = Array.from(this.tunesInstances.values());
|
||||
const tunesDefinedInTool = [ this.toolInstance.renderSettings() ].flat();
|
||||
const tunesDefinedInTool =
|
||||
typeof this.toolInstance.renderSettings === 'function'
|
||||
? [ this.toolInstance.renderSettings() ].flat()
|
||||
: [];
|
||||
const otherTunes = customTunesInstances.concat(defaultTunesInstances).map(item => item.render());
|
||||
|
||||
tunesDefinedInTool.concat(otherTunes).forEach(rendered => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue