2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
9 M.core_group.init_index = function(Y, wwwroot, courseid) {
10 M.core_group.groupsCombo = new UpdatableGroupsCombo(wwwroot, courseid);
11 M.core_group.membersCombo = new UpdatableMembersCombo(wwwroot, courseid);
14 M.core_group.groupslist = function(Y, preventgroupremoval) {
17 // We need to add check_deletable both on change for the groups, and then call it the first time the page loads
18 Y.one('#groups').on('change', this.check_deletable, this);
19 this.check_deletable();
21 check_deletable : function() {
22 // Ensure that if the 'preventremoval' attribute is set, the delete button is greyed out
24 var optionselected = false;
25 Y.one('#groups').get('options').each(function(option) {
26 if (option.get('selected')) {
27 optionselected = true;
28 if (option.getAttribute('value') in preventgroupremoval) {
33 var deletebutton = Y.one('#deletegroup');
34 if (candelete && optionselected) {
35 deletebutton.removeAttribute('disabled');
37 deletebutton.setAttribute('disabled', 'disabled');