diff --git a/assets/js/components/userSelect/userSelect.js b/assets/js/components/userSelect/userSelect.js index b89fab76..3cb98dcd 100644 --- a/assets/js/components/userSelect/userSelect.js +++ b/assets/js/components/userSelect/userSelect.js @@ -67,7 +67,6 @@ ComunicWeb.components.userSelect = { * @return {String} The formated informations */ formatUser: function(infos){ - console.log(infos); if(!infos.id) return infos.id; @@ -75,4 +74,30 @@ ComunicWeb.components.userSelect = { return $(" " + infos.text + ""); }, + /** + * Returns the results of a specified select element + * + * @param {HTMLElement} inputSelect The target element + * @return {Object} An object with all the select IDs + */ + getResults: function(inputSelect){ + + //Prepare return + 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; + } + } + + //Return result IDs + return usersID; + + } }; \ No newline at end of file