]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes JS, email 25/10/06 from Juliette (Bug MDL-7380 "groups".)
authornfreear <nfreear>
Tue, 7 Nov 2006 15:48:29 +0000 (15:48 +0000)
committernfreear <nfreear>
Tue, 7 Nov 2006 15:48:29 +0000 (15:48 +0000)
group/groupui/main-selects-form.js

index 3b5c08ef2e2d8e74f472f6fed5c9d5cb1fd15b84..d936242a0e13c5d26ae9d00a7535b04d7a8dcc0d 100644 (file)
@@ -3,8 +3,8 @@
  * and to take information from XML documents and either return information from them or modifiy the 
  * form appropriately. 
  */
+
+
 function onGroupingChange() {
        hideAllForms();
        showElement("groupeditform");
@@ -129,26 +129,15 @@ function updateGroupings() {
 
 var updateGroupingsResponseCallback = 
 { 
-  success:updateGroupingsResponse, 
-  failure:responseFailure, 
-};
+  success:function(o) {
 
-
-/**
- *  The callback function for updateGroupings()
- * Takes the XML containing the grouping details that has been sent back and updates the display. 
- */
-function updateGroupingsResponse() {
-       
-       alert("Called updateGroupingsResponse");        
-    if (updategroupingsrequest.readyState == 4 && updategroupingsrequest.status == 200) {
-        alert("updateGroupingsResponse called");
-       var xmlDoc = updategroupingsrequest.responseXML;
-       error = getFromXML(updategroupingsrequest.responseXML, 'error');
+        // alert("updateGroupingsResponse called");
+       var xmlDoc = o.responseXML;
+       error = getFromXML(o.responseXML, 'error');
        if (error != null) {
                alert(error);   
        }               
-       alert(updategroupingsrequest.responseText);
+       // alert(o.responseXML);
        var noofoptions = addOptionsFromXML("groupings", xmlDoc);
        
        // If the selected grouping is not set, set it to the first grouping in the list
@@ -173,8 +162,12 @@ function updateGroupingsResponse() {
                enableButton("showcreategroupform");
                enableButton("showaddgroupstogroupingform");
        }
-    }
-}
+}, 
+  failure:responseFailure, 
+};
+
+
+
 
 /** 
  * Updates the list of groups when groupingid is marked as selected
@@ -245,11 +238,3 @@ function updateSelectedGroupResponse() {
 }
 
 
-
-
-
-
-
-
-
-