From 0a0e23043b109b2de18d4e9d173ee1054e9eebe7 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 25 Dec 2019 20:08:46 +0100 Subject: [PATCH] Destroy RTE module --- src/editor/model/Editor.js | 4 +++- src/rich_text_editor/index.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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`,