From b67f3bc6939efcf19c5244bde1cc62af3072a49f Mon Sep 17 00:00:00 2001 From: Davo Smith Date: Tue, 3 Oct 2017 09:06:54 +0100 Subject: [PATCH] MDL-60012 form: improve clarity of elementsByName code --- lib/form/form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/form/form.js b/lib/form/form.js index 81f2b3bf00c..2eaea03d9ff 100644 --- a/lib/form/form.js +++ b/lib/form/form.js @@ -96,7 +96,7 @@ if (typeof M.form.dependencyManager === 'undefined') { allnames[name].push(node); } }); - this._nameCollections = [names, allnames]; + this._nameCollections = {names: names, allnames: allnames}; }, /** @@ -111,7 +111,7 @@ if (typeof M.form.dependencyManager === 'undefined') { if (includeGroups === undefined) { includeGroups = false; } - var collection = (includeGroups ? 1 : 0); + var collection = (includeGroups ? 'allnames' : 'names'); if (!this._nameCollections) { this.initElementsByName();