From 89b7bbe9eee729587de6faa3ec79a9bd6fc326c0 Mon Sep 17 00:00:00 2001 From: Chris Scribner Date: Fri, 11 Nov 2011 13:31:09 -0500 Subject: [PATCH] MDL-20534 lti: A9. Fixing issues with the course tool popup not disappearing. --- mod/lti/instructor_edit_tool_type.php | 32 ++++++++++++++++----------- mod/lti/mod_form.js | 17 ++++++++------ 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/mod/lti/instructor_edit_tool_type.php b/mod/lti/instructor_edit_tool_type.php index ad4a88d8e22..36c56b5de79 100644 --- a/mod/lti/instructor_edit_tool_type.php +++ b/mod/lti/instructor_edit_tool_type.php @@ -46,8 +46,6 @@ if (!empty($typeid)) { } } -echo $OUTPUT->header(); - $data = data_submitted(); if (isset($data->submitbutton) && confirm_sesskey()) { @@ -64,10 +62,12 @@ if (isset($data->submitbutton) && confirm_sesskey()) { //Output script to update the calling window. $script = " - + + + "; echo $script; @@ -83,10 +83,12 @@ if (isset($data->submitbutton) && confirm_sesskey()) { //Output script to update the calling window. $script = " - + + + "; echo $script; @@ -95,9 +97,11 @@ if (isset($data->submitbutton) && confirm_sesskey()) { } } else if (isset($data->cancel)) { $script = " - + + + "; echo $script; @@ -110,6 +114,8 @@ if ($action == 'delete') { die; } +echo $OUTPUT->header(); + echo $OUTPUT->heading(get_string('toolsetup', 'lti')); if ($action == 'add') { diff --git a/mod/lti/mod_form.js b/mod/lti/mod_form.js index d9c94f31e19..46b8718457c 100644 --- a/mod/lti/mod_form.js +++ b/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(){