~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/media/groups/groups.js

  • Committer: dcoles
  • Date: 2008-08-11 02:16:38 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1014
Groups: Small interface bug fix. Will now refresh the group information when 
you add a group member.

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
    var elem = document.getElementById(namespace);
131
131
    var button = document.getElementById(namespace+"_button");
132
132
    var manage_div = document.createElement("div")
 
133
    manage_div.id = namespace + "_contents";
133
134
    elem.insertBefore(manage_div, button);
134
 
 
 
135
    
 
136
    /* Refresh contents */
 
137
    list_projectgroup_contents(offeringid, groupid, manage_div.id);
 
138
 
 
139
    /* Remove the button element */
 
140
    elem.removeChild(button);
 
141
}
 
142
 
 
143
/* Lists the information about a particular project group identified by groupid 
 
144
 * in an offering identified by offeringid in the element with id elemnm. May 
 
145
 * be called multiple times safely to refresh the displayed information.
 
146
 */
 
147
function list_projectgroup_contents(offeringid, groupid, elemnm)
 
148
{
 
149
    var contents = document.getElementById(elemnm);
 
150
    dom_removechildren(contents);
135
151
    var callback = function(xhr)
136
152
    {
137
153
        var members = JSON.parse(xhr.responseText);
163
179
        {
164
180
            args = {'login': select.value, 'groupid': groupid};
165
181
            ajax_call(null, serviceapp, 'assign_group', args, 'POST');
 
182
            list_projectgroup_contents(offeringid, groupid, elemnm);
166
183
        }, false);
167
184
        add_li.appendChild(select);
168
185
        add_li.appendChild(button);
169
186
        ul.appendChild(add_li);
170
 
        manage_div.appendChild(ul);
 
187
        contents.appendChild(ul);
171
188
    }
172
189
    var args = {'offeringid': offeringid, 'groupid': groupid};
173
190
    ajax_call(callback, serviceapp, 'get_group_membership', args, 'GET');
174
 
    /* Remove the button element */
175
 
    elem.removeChild(button);
 
191
 
176
192
}