Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-20534 lti: A9. Fixing issues with the course tool popup not disap…

…pearing.
  • Loading branch information...
commit 89b7bbe9eee729587de6faa3ec79a9bd6fc326c0 1 parent 4febc0a
scriby authored November 11, 2011
32  mod/lti/instructor_edit_tool_type.php
@@ -46,8 +46,6 @@
46 46
     }
47 47
 }
48 48
 
49  
-echo $OUTPUT->header();
50  
-
51 49
 $data = data_submitted();
52 50
 
53 51
 if (isset($data->submitbutton) && confirm_sesskey()) {
@@ -64,10 +62,12 @@
64 62
 
65 63
         //Output script to update the calling window.
66 64
         $script = "
67  
-            <script type=\"text/javascript\">
68  
-                window.opener.M.mod_lti.editor.updateToolType({$json});
69  
-                window.close();
70  
-            </script>
  65
+            <html>
  66
+                <script type=\"text/javascript\">
  67
+                    window.opener.M.mod_lti.editor.updateToolType({$json});
  68
+                    window.close();
  69
+                </script>
  70
+            </html>
71 71
         ";
72 72
 
73 73
         echo $script;
@@ -83,10 +83,12 @@
83 83
 
84 84
         //Output script to update the calling window.
85 85
         $script = "
86  
-            <script type=\"text/javascript\">
87  
-                window.opener.M.mod_lti.editor.addToolType({$json});
88  
-                window.close();
89  
-            </script>
  86
+            <html>
  87
+                <script type=\"text/javascript\">
  88
+                    window.opener.M.mod_lti.editor.addToolType({$json});
  89
+                    window.close();
  90
+                </script>
  91
+            </html>
90 92
         ";
91 93
 
92 94
         echo $script;
@@ -95,9 +97,11 @@
95 97
     }
96 98
 } else if (isset($data->cancel)) {
97 99
     $script = "
98  
-        <script type=\"text/javascript\">
99  
-            window.close();
100  
-        </script>
  100
+        <html>
  101
+            <script type=\"text/javascript\">
  102
+                window.close();
  103
+            </script>
  104
+        </html>
101 105
     ";
102 106
 
103 107
     echo $script;
@@ -110,6 +114,8 @@
110 114
     die;
111 115
 }
112 116
 
  117
+echo $OUTPUT->header();
  118
+
113 119
 echo $OUTPUT->heading(get_string('toolsetup', 'lti'));
114 120
 
115 121
 if ($action == 'add') {
17  mod/lti/mod_form.js
@@ -107,9 +107,9 @@
107 107
             }
108 108
 
109 109
             var selectedToolType = typeSelector.get('value');
110  
-            var selectedOption = typeSelector.one('option[value=' + selectedToolType + ']');
  110
+            var selectedOption = typeSelector.one('option[value="' + selectedToolType + '"]');
111 111
 
112  
-            //A specific tool type is selected (not "auto")"
  112
+            //A specific tool type is selected (not "auto")
113 113
             if(selectedToolType > 0){
114 114
                 //If the entered domain matches the domain of the tool configuration...
115 115
                 var domainRegex = /(?:https?:\/\/)?(?:www\.)?([^\/]+)(?:\/|$)/i;
@@ -158,7 +158,7 @@
158 158
         getSelectedToolTypeOption: function(){
159 159
             var typeSelector = Y.one('#id_typeid');
160 160
 
161  
-            return typeSelector.one('option[value=' + typeSelector.get('value') + ']');
  161
+            return typeSelector.one('option[value="' + typeSelector.get('value') + '"]');
162 162
         },
163 163
 
164 164
         /**
@@ -285,19 +285,21 @@
285 285
 
286 286
             //Adding the new tool may affect which tool gets matched automatically
287 287
             this.clearToolCache();
288  
-            this.updateAutomaticToolMatch();
  288
+            this.updateAutomaticToolMatch(Y.one('#id_toolurl'));
  289
+            this.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
289 290
         },
290 291
 
291 292
         updateToolType: function(toolType){
292 293
             var typeSelector = Y.one('#id_typeid');
293 294
 
294  
-            var option = typeSelector.one('option[value=' + toolType.id + ']');
  295
+            var option = typeSelector.one('option[value="' + toolType.id + '"]');
295 296
             option.set('text', toolType.name)
296 297
                   .set('domain', toolType.tooldomain);
297 298
 
298 299
             //Editing the tool may affect which tool gets matched automatically
299 300
             this.clearToolCache();
300  
-            this.updateAutomaticToolMatch();
  301
+            this.updateAutomaticToolMatch(Y.one('#id_toolurl'));
  302
+            this.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
301 303
         },
302 304
 
303 305
         deleteTool: function(toolTypeId){
@@ -310,7 +312,8 @@
310 312
 
311 313
                         //Editing the tool may affect which tool gets matched automatically
312 314
                         self.clearToolCache();
313  
-                        self.updateAutomaticToolMatch();
  315
+                        self.updateAutomaticToolMatch(Y.one('#id_toolurl'));
  316
+                        self.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
314 317
                     },
315 318
                     failure: function(){
316 319
 

0 notes on commit 89b7bbe

Please sign in to comment.
Something went wrong with that request. Please try again.