elegance-js 2.1.2 → 2.1.3

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.
@@ -340,16 +340,6 @@ var loadPage = async (previousPage = null) => {
340
340
  xmlSerializer.serializeToString(doc)
341
341
  );
342
342
  history.replaceState(null, "", fixedUrl.href);
343
- {
344
- const pageDataScript = document.head.querySelector(`script[data-page="true"][data-pathname="${sanitizePathname(pathname)}"]`);
345
- const { data } = await import(pageDataScript.src);
346
- if (!pd[pathname]) pd[pathname] = data;
347
- {
348
- const dataScript = document.querySelector(`script[data-hook="true"][data-pathname="${sanitizePathname(pathname)}"]`);
349
- if (dataScript) dataScript.remove();
350
- }
351
- initPageData(pd[pathname], currentPage, previousPage, 1 /* STRICT */);
352
- }
353
343
  {
354
344
  const parts = window.location.pathname.split("/").filter(Boolean);
355
345
  const paths = [
@@ -370,6 +360,16 @@ var loadPage = async (previousPage = null) => {
370
360
  initPageData(ld[pathname], path, previousPage, 2 /* SCOPED */);
371
361
  }
372
362
  }
363
+ {
364
+ const pageDataScript = document.head.querySelector(`script[data-page="true"][data-pathname="${sanitizePathname(pathname)}"]`);
365
+ const { data } = await import(pageDataScript.src);
366
+ if (!pd[pathname]) pd[pathname] = data;
367
+ {
368
+ const dataScript = document.querySelector(`script[data-hook="true"][data-pathname="${sanitizePathname(pathname)}"]`);
369
+ if (dataScript) dataScript.remove();
370
+ }
371
+ initPageData(pd[pathname], currentPage, previousPage, 1 /* STRICT */);
372
+ }
373
373
  console.info(
374
374
  `Loading finished, cleanupProcedures are currently:`,
375
375
  cleanupProcedures
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elegance-js",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Web-Framework",
5
5
  "type": "module",
6
6
  "bin": {