mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 15:25:26 +00:00
Simplified variable naming
This commit is contained in:
parent
a10e43d619
commit
319c1a7f5a
16
src/htmx.js
16
src/htmx.js
@ -1595,10 +1595,8 @@ return (function () {
|
|||||||
|
|
||||||
function getInputValues(elt, verb) {
|
function getInputValues(elt, verb) {
|
||||||
var processed = [];
|
var processed = [];
|
||||||
var values = {
|
var values = {};
|
||||||
form: {},
|
var formValues = {};
|
||||||
other: {},
|
|
||||||
};
|
|
||||||
var errors = [];
|
var errors = [];
|
||||||
|
|
||||||
// only validate when form is directly submitted and novalidate is not set
|
// only validate when form is directly submitted and novalidate is not set
|
||||||
@ -1606,25 +1604,25 @@ return (function () {
|
|||||||
|
|
||||||
// for a non-GET include the closest form
|
// for a non-GET include the closest form
|
||||||
if (verb !== 'get') {
|
if (verb !== 'get') {
|
||||||
processInputValue(processed, values.form, errors, closest(elt, 'form'), validate);
|
processInputValue(processed, formValues, errors, closest(elt, 'form'), validate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// include the element itself
|
// include the element itself
|
||||||
processInputValue(processed, values.other, errors, elt, validate);
|
processInputValue(processed, values, errors, elt, validate);
|
||||||
|
|
||||||
// include any explicit includes
|
// include any explicit includes
|
||||||
var includes = getClosestAttributeValue(elt, "hx-include");
|
var includes = getClosestAttributeValue(elt, "hx-include");
|
||||||
if (includes) {
|
if (includes) {
|
||||||
var nodes = getDocument().querySelectorAll(includes);
|
var nodes = getDocument().querySelectorAll(includes);
|
||||||
forEach(nodes, function(node) {
|
forEach(nodes, function(node) {
|
||||||
processInputValue(processed, values.other, errors, node, validate);
|
processInputValue(processed, values, errors, node, validate);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// values in closest form take precedence
|
// values in closest form take precedence
|
||||||
var mergedValues = mergeObjects(values.other, values.form);
|
values = mergeObjects(values, formValues);
|
||||||
|
|
||||||
return {errors:errors, values:mergedValues};
|
return {errors:errors, values};
|
||||||
}
|
}
|
||||||
|
|
||||||
function appendParam(returnStr, name, realValue) {
|
function appendParam(returnStr, name, realValue) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user