This commit is contained in:
Tanya Fomina 2024-05-04 16:56:15 +03:00
parent d93cdea7d3
commit 6fe4b44eba

View file

@ -610,9 +610,8 @@ export default class Block extends EventsDispatcher<BlockEvents> {
} }
/** /**
* Returns data to render in tunes menu. * Returns data to render in Block Tunes menu.
* Splits block tunes into 3 groups: block specific tunes, common tunes * Splits block tunes into 2 groups: block specific tunes and common tunes
* and custom html that is produced by combining tunes html from both previous groups
*/ */
public getTunes(): { public getTunes(): {
toolTunes: PopoverItemParams[]; toolTunes: PopoverItemParams[];
@ -661,7 +660,6 @@ export default class Block extends EventsDispatcher<BlockEvents> {
}; };
} }
/** /**
* Update current input index with selection anchor node * Update current input index with selection anchor node
*/ */
@ -747,25 +745,6 @@ export default class Block extends EventsDispatcher<BlockEvents> {
return convertBlockDataToString(blockData, this.tool.conversionConfig); return convertBlockDataToString(blockData, this.tool.conversionConfig);
} }
/**
* Determines if tool's tunes settings are custom html or popover params and separates one from another by putting to different object fields
*
* @param tunes - tool's tunes config
*/
private getTunesDataSegregated(tunes: HTMLElement | TunesMenuConfig): { htmlElement?: HTMLElement; items: PopoverItemParams[] } {
const result = { } as { htmlElement?: HTMLElement; items: PopoverItemParams[] };
if ($.isElement(tunes)) {
result.htmlElement = tunes as HTMLElement;
} else if (Array.isArray(tunes)) {
result.items = tunes as PopoverItemParams[];
} else {
result.items = [ tunes ];
}
return result;
}
/** /**
* Make default Block wrappers and put Tool`s content there * Make default Block wrappers and put Tool`s content there
* *