diff --git a/www/test/1.1.0/src/htmx.js b/www/test/1.1.0/src/htmx.js index 385299ff..55a64ab9 100644 --- a/www/test/1.1.0/src/htmx.js +++ b/www/test/1.1.0/src/htmx.js @@ -331,32 +331,6 @@ return (function () { while (elt = elt && parentElt(elt)); } - // Like querySelectorAll, but supports [closest] and [find] - // and other features that might have been added w/o updating this comment - // returns Array | NodeList - function querySelectorAllWithFeatures(eltOrSelector, selector) { - var elt; - if (selector === undefined) { - selector = eltOrSelector; - elt = getDocument(); - } else { - elt = eltOrSelector; - } - - if (selector.indexOf("closest ") === 0) { - return [closest(elt, selector.substr(8))]; - } else if (selector.indexOf("find ") === 0) { - return [find(elt, selector.substr(5))]; - } else { - return getDocument().querySelectorAll(selector); - } - } - - // See querySelectorAllWithFeatures - function querySelectorWithFeatures(eltOrSelector, selector) { - return querySelectorAllWithFeatures(eltOrSelector, selector)[0] - } - function resolveTarget(arg2) { if (isType(arg2, 'String')) { return find(arg2); @@ -409,8 +383,12 @@ return (function () { var targetStr = getAttributeValue(explicitTarget, "hx-target"); if (targetStr === "this") { return explicitTarget; + } else if (targetStr.indexOf("closest ") === 0) { + return closest(elt, targetStr.substr(8)); + } else if (targetStr.indexOf("find ") === 0) { + return find(elt, targetStr.substr(5)); } else { - return querySelectorWithFeatures(elt, targetStr) + return getDocument().querySelector(targetStr); } } else { var data = getInternalData(elt); @@ -1615,18 +1593,6 @@ return (function () { } } - function descendantsToInclude(elt) { - var rv = []; - var descendants = elt.querySelectorAll('*') - forEach(descendants, function (descendant) { - if (shouldInclude(descendant)) { - rv.push(descendant); - } - }) - - return rv; - } - function getInputValues(elt, verb) { var processed = []; var values = { @@ -1650,15 +1616,9 @@ return (function () { // include any explicit includes var includes = getClosestAttributeValue(elt, "hx-include"); if (includes) { - var nodes = querySelectorAllWithFeatures(elt, includes); + var nodes = getDocument().querySelectorAll(includes); forEach(nodes, function(node) { processInputValue(processed, values.includes, errors, node, validate); - if (!shouldInclude(node)) { - var descendants = descendantsToInclude(node); - forEach(descendants, function (descendant) { - processInputValue(processed, values.includes, errors, descendant, validate); - }) - } }); }