Browse Source

Fix block manager rendering with custom appendTo

pull/3905/head
Artur Arseniev 5 years ago
parent
commit
e79bb386c7
  1. 6
      src/commands/view/OpenBlocks.js

6
src/commands/view/OpenBlocks.js

@ -4,13 +4,13 @@ import { createEl } from '../../utils/dom';
export default { export default {
open() { open() {
const { container, editor, bm, config } = this; const { container, editor, bm, config } = this;
const { custom } = config; const { custom, appendTo } = config;
if (isFunction(custom.open)) { if (isFunction(custom.open)) {
return custom.open(bm.__customData()); return custom.open(bm.__customData());
} }
if (this.firstRender) { if (this.firstRender && !appendTo) {
const id = 'views-container'; const id = 'views-container';
const pn = editor.Panels; const pn = editor.Panels;
const panels = pn.getPanel(id) || pn.addPanel({ id }); const panels = pn.getPanel(id) || pn.addPanel({ id });
@ -32,7 +32,7 @@ export default {
if (container) container.style.display = 'none'; if (container) container.style.display = 'none';
}, },
run(editor, sender) { run(editor) {
const bm = editor.Blocks; const bm = editor.Blocks;
this.config = bm.getConfig(); this.config = bm.getConfig();
this.firstRender = !this.container; this.firstRender = !this.container;

Loading…
Cancel
Save