diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 818c51871..7edc8b118 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -656,7 +656,8 @@ export default Backbone.Model.extend({ UndoManager, Panels, Canvas, - Keymaps + Keymaps, + RichTextEditor } = this.attributes; DomComponents.clear(); CssComposer.clear(); @@ -664,6 +665,7 @@ export default Backbone.Model.extend({ Panels.getPanels().reset(); Canvas.getCanvasView().remove(); Keymaps.removeAll(); + RichTextEditor.destroy(); this.view.remove(); this.stopListening(); $(this.config.el) diff --git a/src/rich_text_editor/index.js b/src/rich_text_editor/index.js index 29b183d96..ba3489a97 100644 --- a/src/rich_text_editor/index.js +++ b/src/rich_text_editor/index.js @@ -115,7 +115,7 @@ export default () => { const pfx = this.pfx; const actionbarContainer = toolbar; const actionbar = this.actionbar; - const actions = this.actions || config.actions; + const actions = this.actions || [...config.actions]; const classes = { actionbar: `${pfx}actionbar`, button: `${pfx}action`,