Browse Source

Load DomComponents before CSSComposer to avoid removing ID rules

pull/2436/head
Artur Arseniev 6 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;
if ((result && result.length) || isObj) {
this.clear();
// If the result is an object I consider it the wrapper
if (isObj) {
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) {
cfg.stm = sm;
const storables = this.get('storables');
storables.push(Mod);
this.set('storables', storables);
// DomComponents should be load before CSS Composer
const mth = name == 'domComponents' ? 'unshift' : 'push';
this.get('storables')[mth](Mod);
}
cfg.em = this;
@ -508,9 +508,7 @@ export default Backbone.Model.extend({
*/
load(clb = null) {
this.getCacheLoad(1, res => {
const storables = this.get('storables');
storables.forEach(module => module.clear && module.clear());
storables.forEach(module => module.load(res));
this.get('storables').forEach(module => module.load(res));
clb && clb(res);
});
},

Loading…
Cancel
Save