MDL-60012 form: improve clarity of elementsByName code

This commit is contained in:
Davo Smith 2017-10-03 09:06:54 +01:00
parent 8cab0a2571
commit b67f3bc693

View File

@ -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();