Follows-up
c310e7b40c,
daa92bb06e.
The $( Array ) signature requires the list to contain DOM nodes,
not jQuery objects. The fields variable should be a list of
nodes, not jQuery collections.
Also:
* Improve @return documentation for hideIfParse().
* Flag hideIfParse() and hideIfGetField() as private to remove them
from the jQuery#htmlform API documentation as methods that would
be mixed into the jQuery prototype (they're not).
Bug: 67685
Change-Id: I4bb93ad234cdd4a1f412b759065138e2831be2a6
* ending in array keys matching the given name (e.g. "baz" matches
* "foo[bar][baz]").
*
* ending in array keys matching the given name (e.g. "baz" matches
* "foo[bar][baz]").
*
* @param {jQuery} element
* @param {string} name
* @return {jQuery|null}
* @param {jQuery} element
* @param {string} name
* @return {jQuery|null}
* Helper function for hide-if to return a test function and list of
* dependent fields for a hide-if specification.
*
* Helper function for hide-if to return a test function and list of
* dependent fields for a hide-if specification.
*
* @param {jQuery} element
* @param {Array} hide-if spec
* @param {jQuery} element
* @param {Array} hide-if spec
- * @return {Array} 2 elements: jQuery of dependent fields, and test function
+ * @return {Array}
+ * @return {jQuery} return.0 Dependent fields
+ * @return {Function} return.1 Test function
*/
function hideIfParse( $el, spec ) {
var op, i, l, v, $field, $fields, fields, func, funcs, getVal;
*/
function hideIfParse( $el, spec ) {
var op, i, l, v, $field, $fields, fields, func, funcs, getVal;
throw new Error( op + ' parameters must be arrays' );
}
v = hideIfParse( $el, spec[i] );
throw new Error( op + ' parameters must be arrays' );
}
v = hideIfParse( $el, spec[i] );
+ fields = fields.concat( v[0].toArray() );
funcs.push( v[1] );
}
$fields = $( fields );
funcs.push( v[1] );
}
$fields = $( fields );