mol_dump_lib 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/node.js CHANGED
@@ -2339,6 +2339,15 @@ var $;
2339
2339
  let all = [];
2340
2340
  let el = null;
2341
2341
  let timer = null;
2342
+ function $mol_style_attach_force() {
2343
+ if (all.length) {
2344
+ el.innerHTML += '\n' + all.join('\n\n');
2345
+ all = [];
2346
+ }
2347
+ timer = null;
2348
+ return el;
2349
+ }
2350
+ $.$mol_style_attach_force = $mol_style_attach_force;
2342
2351
  function $mol_style_attach(id, text) {
2343
2352
  all.push(`/* ${id} */\n\n${text}`);
2344
2353
  if (timer)
@@ -2349,12 +2358,7 @@ var $;
2349
2358
  el = doc.createElement('style');
2350
2359
  el.id = `$mol_style_attach`;
2351
2360
  doc.head.appendChild(el);
2352
- timer = new $mol_after_tick(() => {
2353
- el.innerHTML = '\n' + all.join('\n\n');
2354
- all = [];
2355
- el = null;
2356
- timer = null;
2357
- });
2361
+ timer = new $mol_after_tick($mol_style_attach_force);
2358
2362
  return el;
2359
2363
  }
2360
2364
  $.$mol_style_attach = $mol_style_attach;
@@ -3016,7 +3020,7 @@ var $;
3016
3020
  this.attachShadow({ mode: 'open' });
3017
3021
  const node = this.view.dom_node();
3018
3022
  node.setAttribute('mol_view_root', '');
3019
- this.shadowRoot.append(document.getElementById(`$mol_style_attach`).cloneNode(true), node);
3023
+ this.shadowRoot.append($mol_style_attach_force().cloneNode(true), node);
3020
3024
  }
3021
3025
  this.root = $mol_wire_auto();
3022
3026
  try {