Include node as 'source' for preload so hx-sync/queue works properly

This commit is contained in:
Clint Checketts 2023-06-13 11:52:41 -06:00
parent dd53ca0a75
commit f39c0be9b6

View File

@ -48,9 +48,12 @@ htmx.defineExtension("preload", {
// in the future
var hxGet = node.getAttribute("hx-get") || node.getAttribute("data-hx-get")
if (hxGet) {
htmx.ajax("GET", hxGet, {handler:function(elt, info) {
done(info.xhr.responseText);
}});
htmx.ajax("GET", hxGet, {
source: node,
handler:function(elt, info) {
done(info.xhr.responseText);
}
});
return;
}