Browse Source

Add destroy method to SelectorManager module

pull/3147/head
Artur Arseniev 6 years ago
parent
commit
5171dd9837
  1. 4
      src/editor/model/Editor.js
  2. 9
      src/selector_manager/index.js

4
src/editor/model/Editor.js

@ -766,7 +766,8 @@ export default Backbone.Model.extend({
DeviceManager,
I18n,
Modal,
Parser
Parser,
SelectorManager
} = this.attributes;
this.stopDefault();
DomComponents.destroy();
@ -785,6 +786,7 @@ export default Backbone.Model.extend({
I18n.destroy();
Modal.destroy();
Parser.destroy();
SelectorManager.destroy();
this.view.remove();
this.stopListening();
this.clear({ silent: true });

9
src/selector_manager/index.js

@ -312,6 +312,15 @@ export default config => {
});
return this.selectorTags.render().el;
} else return this.selectorTags.render().el;
},
destroy() {
selectors.reset();
selectors.stopListening();
this.selectorTags.remove();
[c, selectors].forEach(i => (i = {}));
this.em = {};
this.selectorTags = {};
}
};
};

Loading…
Cancel
Save