mirror of
https://github.com/codex-team/editor.js
synced 2026-03-18 08:29:52 +01:00
Fix for iframe
This commit is contained in:
parent
1d34042727
commit
18283c9b5e
3 changed files with 4 additions and 42 deletions
|
|
@ -643,34 +643,6 @@ export default class Block extends EventsDispatcher<BlockEvents> {
|
|||
return isValid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns rendered custom block tunes
|
||||
*/
|
||||
public getTunesRendered(): DocumentFragment {
|
||||
const tunesElement = document.createDocumentFragment();
|
||||
|
||||
// this.tunesInstances.forEach((tune) => {
|
||||
// $.append(tunesElement, tune.render());
|
||||
// });
|
||||
|
||||
return tunesElement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns list of tunes available for block in popover format
|
||||
*/
|
||||
public getTunesList(): PopoverItem[] {
|
||||
const customTunesInstances = Array.from(this.tunesInstances.values());
|
||||
const defaultTunesInstances = Array.from(this.defaultTunesInstances.values());
|
||||
const tunesDefinedInTool = [ this.toolInstance.render() ].flat();
|
||||
|
||||
const otherTunes = customTunesInstances.concat(defaultTunesInstances)
|
||||
.map(tune => tune.render())
|
||||
.filter(item => !!item);
|
||||
|
||||
return tunesDefinedInTool.concat(otherTunes).filter(item => !item.isActive);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns data to render in tunes menu.
|
||||
* Splits block tunes settings into 2 groups: popover items and custom html.
|
||||
|
|
@ -688,7 +660,9 @@ export default class Block extends EventsDispatcher<BlockEvents> {
|
|||
const otherTunes = customTunesInstances.concat(defaultTunesInstances).map(item => item.render());
|
||||
|
||||
tunesDefinedInTool.concat(otherTunes).forEach(rendered => {
|
||||
if (rendered instanceof HTMLElement) {
|
||||
const isHTMLElement = rendered.nodeName !== undefined;
|
||||
|
||||
if (isHTMLElement) {
|
||||
tunesElement.appendChild(rendered);
|
||||
} else {
|
||||
const normalized = [ rendered ].flat();
|
||||
|
|
@ -768,16 +742,6 @@ export default class Block extends EventsDispatcher<BlockEvents> {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call Tool instance renderSettings method
|
||||
*/
|
||||
public renderSettings(): HTMLElement | undefined {
|
||||
return undefined;
|
||||
// if (_.isFunction(this.toolInstance.renderSettings)) {
|
||||
// return this.toolInstance.renderSettings();
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* Tool could specify several entries to be displayed at the Toolbox (for example, "Heading 1", "Heading 2", "Heading 3")
|
||||
* This method returns the entry that is related to the Block (depended on the Block data)
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@
|
|||
visibility: hidden;
|
||||
}
|
||||
|
||||
&__custom-content {
|
||||
&__custom-content:not(:empty) {
|
||||
padding: 4px;
|
||||
|
||||
@media (--not-mobile) {
|
||||
|
|
|
|||
2
types/tools/block-tool.d.ts
vendored
2
types/tools/block-tool.d.ts
vendored
|
|
@ -30,8 +30,6 @@ export interface BlockTool extends BaseTool {
|
|||
*/
|
||||
renderSettings?(): HTMLElement | TunesMenuConfig;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Validate Block's data
|
||||
* @param {BlockToolData} blockData
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue