Created
May 31, 2015 12:10
-
-
Save tranepura/e2c7c9705d27f79671e4 to your computer and use it in GitHub Desktop.
MDL -29774 Fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Updates the current groups information shown about a user when a user is selected. | |
| * | |
| * @global {Array} userSummaries | |
| * userSummaries is added to the page via /user/selector/lib.php - group_non_members_selector::print_user_summaries() | |
| * as a global that can be used by this function. | |
| */ | |
| function updateUserSummary() { | |
| var selectEl = document.getElementById('addselect'), | |
| summaryDiv = document.getElementById('group-usersummary'), | |
| length = selectEl.length, | |
| selectCnt = 0, | |
| selectIdx = -1, | |
| selectedUID =0, | |
| i; | |
| for (i = 0; i < length; i++) { | |
| if (selectEl.options[i].selected) { | |
| selectCnt++; | |
| selectIdx = selectEl.options[i].value; | |
| } | |
| } | |
| if (selectCnt == 1 && userSummaries[selectIdx]) { | |
| summaryDiv.innerHTML = userSummaries[selectIdx]; | |
| } | |
| else{ | |
| summaryDiv.innerHTML =''; | |
| } | |
| return true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment