From 32459356179ee552cf7e01bf93a2de4042b4a57b Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 7 Jun 2017 13:52:42 +0200 Subject: [PATCH] Use array rather than object to return results --- assets/js/components/userSelect/userSelect.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/assets/js/components/userSelect/userSelect.js b/assets/js/components/userSelect/userSelect.js index 3cb98dcd..a9c3dda3 100644 --- a/assets/js/components/userSelect/userSelect.js +++ b/assets/js/components/userSelect/userSelect.js @@ -78,21 +78,19 @@ ComunicWeb.components.userSelect = { * Returns the results of a specified select 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){ //Prepare return - var usersID = {}; + var usersID = []; for(i in inputSelect.children){ //Check it is really a children if(inputSelect.children[i].value){ - //Get ID - var userID = inputSelect.children[i].value; - - usersID['user-'+userID] = userID; + //Add ID to the table + usersID.push(inputSelect.children[i].value); } }