mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-28 21:41:40 +00:00
12 lines
359 B
JavaScript
12 lines
359 B
JavaScript
htmx.defineExtension('morphdom-swap', {
|
|
isInlineSwap: function(swapStyle) {
|
|
return swapStyle === 'morphdom';
|
|
},
|
|
handleSwap: function (swapStyle, target, fragment) {
|
|
if (swapStyle === 'morphdom') {
|
|
morphdom(target, fragment.outerHTML);
|
|
return [target]; // let htmx handle the new content
|
|
}
|
|
}
|
|
});
|