Use array rather than object to return results

This commit is contained in:
Pierre 2017-06-07 13:52:42 +02:00
parent 2d0ba1fedc
commit 3245935617

View File

@ -78,21 +78,19 @@ ComunicWeb.components.userSelect = {
* Returns the results of a specified select element * Returns the results of a specified select element
* *
* @param {HTMLElement} inputSelect The target element * @param {HTMLElement} inputSelect The target element
* @return {Object} An object with all the select IDs * @return {Array} An array with all the select IDs
*/ */
getResults: function(inputSelect){ getResults: function(inputSelect){
//Prepare return //Prepare return
var usersID = {}; var usersID = [];
for(i in inputSelect.children){ for(i in inputSelect.children){
//Check it is really a children //Check it is really a children
if(inputSelect.children[i].value){ if(inputSelect.children[i].value){
//Get ID //Add ID to the table
var userID = inputSelect.children[i].value; usersID.push(inputSelect.children[i].value);
usersID['user-'+userID] = userID;
} }
} }