@very-simple/ajax 1.0.0-beta.2 → 1.0.0-beta.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.
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -267,7 +267,6 @@ var visit = async (url, {
|
|
|
267
267
|
const to = { url, state, document: newDocument };
|
|
268
268
|
await emit("before-swap", { from, to, isBackForward, signal });
|
|
269
269
|
if (signal.aborted) return;
|
|
270
|
-
if (morphHeads) Idiomorph2.morph(document.head, newDocument.head);
|
|
271
270
|
const getMergeStrategy = (oldEl, newEl) => newEl.getAttribute(`${config.prefix}merge`) || oldEl.getAttribute(`${config.prefix}merge`) || mergeStrategy;
|
|
272
271
|
let autoFocusEl;
|
|
273
272
|
const hasMatchingRegions = regions?.some(
|
|
@@ -313,14 +312,17 @@ var visit = async (url, {
|
|
|
313
312
|
if (position) window.scrollTo(position);
|
|
314
313
|
};
|
|
315
314
|
if (config.render) {
|
|
315
|
+
if (morphHeads) Idiomorph2.morph(document.head, newDocument.head);
|
|
316
316
|
await config.render(newDocument);
|
|
317
317
|
} else if (viewTransitions && document.startViewTransition) {
|
|
318
318
|
await document.startViewTransition(async () => {
|
|
319
|
+
if (morphHeads) Idiomorph2.morph(document.head, newDocument.head);
|
|
319
320
|
await mergeRegions();
|
|
320
321
|
await emit("after-swap", { from, to, isBackForward, signal });
|
|
321
322
|
applyScrollBehavior();
|
|
322
323
|
}).ready;
|
|
323
324
|
} else {
|
|
325
|
+
if (morphHeads) Idiomorph2.morph(document.head, newDocument.head);
|
|
324
326
|
await mergeRegions();
|
|
325
327
|
await emit("after-swap", { from, to, isBackForward, signal });
|
|
326
328
|
applyScrollBehavior();
|