Improved page navigation and import of on-demand assets

This commit is contained in:
Akira Tempaku 2024-04-21 19:09:58 +09:00
commit 4663341497
14 changed files with 248 additions and 55 deletions
public/vendor/htmx-ext

View file

@ -0,0 +1,16 @@
htmx.defineExtension('alpine-morph', {
isInlineSwap: function (swapStyle) {
return swapStyle === 'morph';
},
handleSwap: function (swapStyle, target, fragment) {
if (swapStyle === 'morph') {
if (fragment.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
Alpine.morph(target, fragment.firstElementChild);
return [target];
} else {
Alpine.morph(target, fragment.outerHTML);
return [target];
}
}
}
});