Browse Source

Load DomComponents before CSSComposer to avoid removing ID rules

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

2
src/dom_components/index.js

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

10
src/editor/model/Editor.js

@ -200,9 +200,9 @@ export default Backbone.Model.extend({
if (Mod.storageKey && Mod.store && Mod.load && sm) { if (Mod.storageKey && Mod.store && Mod.load && sm) {
cfg.stm = sm; cfg.stm = sm;
const storables = this.get('storables'); // DomComponents should be load before CSS Composer
storables.push(Mod); const mth = name == 'domComponents' ? 'unshift' : 'push';
this.set('storables', storables); this.get('storables')[mth](Mod);
} }
cfg.em = this; cfg.em = this;
@ -508,9 +508,7 @@ export default Backbone.Model.extend({
*/ */
load(clb = null) { load(clb = null) {
this.getCacheLoad(1, res => { this.getCacheLoad(1, res => {
const storables = this.get('storables'); this.get('storables').forEach(module => module.load(res));
storables.forEach(module => module.clear && module.clear());
storables.forEach(module => module.load(res));
clb && clb(res); clb && clb(res);
}); });
}, },

Loading…
Cancel
Save