Browse Source

Clear modules before load. Fixes #2402

pull/2436/head
Artur Arseniev 7 years ago
parent
commit
df6b0552e2
  1. 2
      src/dom_components/index.js
  2. 4
      src/editor/model/Editor.js

2
src/dom_components/index.js

@ -389,8 +389,6 @@ export default () => {
const isObj = result && result.constructor === Object;
if ((result && result.length) || isObj) {
this.clear();
// If the result is an object I consider it the wrapper
if (isObj) {
this.getWrapper().set(result);

4
src/editor/model/Editor.js

@ -508,7 +508,9 @@ export default Backbone.Model.extend({
*/
load(clb = null) {
this.getCacheLoad(1, res => {
this.get('storables').forEach(module => module.load(res));
const storables = this.get('storables');
storables.forEach(module => module.clear && module.clear());
storables.forEach(module => module.load(res));
clb && clb(res);
});
},

Loading…
Cancel
Save