mirror of
https://github.com/codex-team/editor.js
synced 2026-03-18 00:19:53 +01:00
Rename and cleanup
This commit is contained in:
parent
9ad9e414d9
commit
3e2f6244f7
2 changed files with 6 additions and 22 deletions
|
|
@ -643,29 +643,13 @@ export default class Block extends EventsDispatcher<BlockEvents> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Enumerates initialized tunes and returns fragment that can be appended to the toolbars area
|
||||
*
|
||||
* @returns {DocumentFragment[]}
|
||||
* Returns list of tunes available for block
|
||||
*/
|
||||
public renderTunes(): [DocumentFragment, DocumentFragment] {
|
||||
const tunesElement = document.createDocumentFragment();
|
||||
const defaultTunesElement = document.createDocumentFragment();
|
||||
public getTunesList(): PopoverItem[] {
|
||||
const tunes = Array.from(this.tunesInstances.values());
|
||||
const defaultTunes = Array.from(this.defaultTunesInstances.values());
|
||||
|
||||
this.tunesInstances.forEach((tune) => {
|
||||
$.append(tunesElement, tune.render());
|
||||
});
|
||||
this.defaultTunesInstances.forEach((tune) => {
|
||||
$.append(defaultTunesElement, tune.render());
|
||||
});
|
||||
|
||||
return [tunesElement, defaultTunesElement];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public getTunesItems(): PopoverItem[] {
|
||||
return Array.from(this.defaultTunesInstances.values())
|
||||
return tunes.concat(defaultTunes)
|
||||
.map(tune => tune.blockSettings)
|
||||
.filter(item => !!item);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ export default class BlockSettings extends Module<BlockSettingsNodes> {
|
|||
searchable: true,
|
||||
filterLabel: I18n.ui(I18nInternalNS.ui.toolbar.toolbox, 'Filter'),
|
||||
nothingFoundLabel: I18n.ui(I18nInternalNS.ui.toolbar.toolbox, 'Nothing found'),
|
||||
items: targetBlock.getTunesItems(),
|
||||
items: targetBlock.getTunesList(),
|
||||
customContent: this.nodes.toolSettings,
|
||||
api: this.Editor.API.methods,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue