Only process anchors and forms if there is an hx-boost in play

This commit is contained in:
carson 2020-11-05 08:56:51 -07:00
parent f7617a4653
commit a599286d5c

View File

@ -1165,9 +1165,14 @@ return (function () {
});
}
function isBoosted() {
return document.querySelector("[hx-boost], [data-hx-boost]");
}
function findElementsToProcess(elt) {
if (elt.querySelectorAll) {
var results = elt.querySelectorAll(VERB_SELECTOR + ", a, form, [hx-sse], [data-hx-sse], [hx-ws]," +
var boostedElts = isBoosted(elt) ? ", a, form" : "";
var results = elt.querySelectorAll(VERB_SELECTOR + boostedElts + ", [hx-sse], [data-hx-sse], [hx-ws]," +
" [data-hx-ws]");
return results;
} else {