diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 3ed09aec9..19bb51274 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -764,7 +764,8 @@ export default Backbone.Model.extend({ CodeManager, Commands, DeviceManager, - I18n + I18n, + Modal } = this.attributes; this.stopDefault(); DomComponents.destroy(); @@ -781,6 +782,7 @@ export default Backbone.Model.extend({ Commands.destroy(); DeviceManager.destroy(); I18n.destroy(); + Modal.destroy(); this.view.remove(); this.stopListening(); this.clear({ silent: true }); diff --git a/src/modal_dialog/index.js b/src/modal_dialog/index.js index e9d6b8503..043a9a5c7 100644 --- a/src/modal_dialog/index.js +++ b/src/modal_dialog/index.js @@ -202,6 +202,12 @@ export default () => { */ render() { return modal.render().$el; + }, + + destroy() { + modal.remove(); + [c, model, modal].forEach(i => (i = {})); + this.em = {}; } }; };