Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…pearing.
  • Loading branch information...
commit 89b7bbe9eee729587de6faa3ec79a9bd6fc326c0 1 parent 4febc0a
@scriby scriby authored
Showing with 29 additions and 20 deletions.
  1. +19 −13 mod/lti/instructor_edit_tool_type.php
  2. +10 −7 mod/lti/mod_form.js
View
32 mod/lti/instructor_edit_tool_type.php
@@ -46,8 +46,6 @@
}
}
-echo $OUTPUT->header();
-
$data = data_submitted();
if (isset($data->submitbutton) && confirm_sesskey()) {
@@ -64,10 +62,12 @@
//Output script to update the calling window.
$script = "
- <script type=\"text/javascript\">
- window.opener.M.mod_lti.editor.updateToolType({$json});
- window.close();
- </script>
+ <html>
+ <script type=\"text/javascript\">
+ window.opener.M.mod_lti.editor.updateToolType({$json});
+ window.close();
+ </script>
+ </html>
";
echo $script;
@@ -83,10 +83,12 @@
//Output script to update the calling window.
$script = "
- <script type=\"text/javascript\">
- window.opener.M.mod_lti.editor.addToolType({$json});
- window.close();
- </script>
+ <html>
+ <script type=\"text/javascript\">
+ window.opener.M.mod_lti.editor.addToolType({$json});
+ window.close();
+ </script>
+ </html>
";
echo $script;
@@ -95,9 +97,11 @@
}
} else if (isset($data->cancel)) {
$script = "
- <script type=\"text/javascript\">
- window.close();
- </script>
+ <html>
+ <script type=\"text/javascript\">
+ window.close();
+ </script>
+ </html>
";
echo $script;
@@ -110,6 +114,8 @@
die;
}
+echo $OUTPUT->header();
+
echo $OUTPUT->heading(get_string('toolsetup', 'lti'));
if ($action == 'add') {
View
17 mod/lti/mod_form.js
@@ -107,9 +107,9 @@
}
var selectedToolType = typeSelector.get('value');
- var selectedOption = typeSelector.one('option[value=' + selectedToolType + ']');
+ var selectedOption = typeSelector.one('option[value="' + selectedToolType + '"]');
- //A specific tool type is selected (not "auto")"
+ //A specific tool type is selected (not "auto")
if(selectedToolType > 0){
//If the entered domain matches the domain of the tool configuration...
var domainRegex = /(?:https?:\/\/)?(?:www\.)?([^\/]+)(?:\/|$)/i;
@@ -158,7 +158,7 @@
getSelectedToolTypeOption: function(){
var typeSelector = Y.one('#id_typeid');
- return typeSelector.one('option[value=' + typeSelector.get('value') + ']');
+ return typeSelector.one('option[value="' + typeSelector.get('value') + '"]');
},
/**
@@ -285,19 +285,21 @@
//Adding the new tool may affect which tool gets matched automatically
this.clearToolCache();
- this.updateAutomaticToolMatch();
+ this.updateAutomaticToolMatch(Y.one('#id_toolurl'));
+ this.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
updateToolType: function(toolType){
var typeSelector = Y.one('#id_typeid');
- var option = typeSelector.one('option[value=' + toolType.id + ']');
+ var option = typeSelector.one('option[value="' + toolType.id + '"]');
option.set('text', toolType.name)
.set('domain', toolType.tooldomain);
//Editing the tool may affect which tool gets matched automatically
this.clearToolCache();
- this.updateAutomaticToolMatch();
+ this.updateAutomaticToolMatch(Y.one('#id_toolurl'));
+ this.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
deleteTool: function(toolTypeId){
@@ -310,7 +312,8 @@
//Editing the tool may affect which tool gets matched automatically
self.clearToolCache();
- self.updateAutomaticToolMatch();
+ self.updateAutomaticToolMatch(Y.one('#id_toolurl'));
+ self.updateAutomaticToolMatch(Y.one('#id_securetoolurl'));
},
failure: function(){
Please sign in to comment.
Something went wrong with that request. Please try again.