Browse Source

Add destroy method to I18n module

pull/3147/head
Artur Arseniev 6 years ago
parent
commit
f8fbfcc8a1
  1. 4
      src/editor/model/Editor.js
  2. 5
      src/i18n/index.js

4
src/editor/model/Editor.js

@ -763,7 +763,8 @@ export default Backbone.Model.extend({
BlockManager,
CodeManager,
Commands,
DeviceManager
DeviceManager,
I18n
} = this.attributes;
this.stopDefault();
DomComponents.destroy();
@ -779,6 +780,7 @@ export default Backbone.Model.extend({
CodeManager.destroy();
Commands.destroy();
DeviceManager.destroy();
I18n.destroy();
this.view.remove();
this.stopListening();
this.clear({ silent: true });

5
src/i18n/index.js

@ -242,6 +242,11 @@ export default () => {
_debug(str, opts = {}) {
const { em, config } = this;
(opts.debug || config.debug) && em && em.logWarning(str);
},
destroy() {
this.config = config;
this.em = {};
}
};
};

Loading…
Cancel
Save