mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
Merge branch 'MDL-73662' of https://github.com/paulholden/moodle
This commit is contained in:
commit
52abd112a9
@ -705,7 +705,7 @@ class renderer extends plugin_renderer_base {
|
||||
$delay = 0;
|
||||
}
|
||||
$this->page->requires->js_init_call('M.mod_quiz.secure_window.close',
|
||||
[$url, $delay], false, quiz_get_js_module());
|
||||
[$url->out(false), $delay], false, quiz_get_js_module());
|
||||
|
||||
$output .= $this->box_end();
|
||||
$output .= $this->footer();
|
||||
|
@ -398,13 +398,26 @@ M.mod_quiz.secure_window = {
|
||||
e.halt();
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize the event listener for the secure window close button
|
||||
*
|
||||
* @param {Object} Y YUI instance. When called from renderer, this parameter precedes the others
|
||||
* @param {String} url
|
||||
*/
|
||||
init_close_button: function(Y, url) {
|
||||
Y.on('click', function(e) {
|
||||
M.mod_quiz.secure_window.close(url, 0)
|
||||
M.mod_quiz.secure_window.close(Y, url, 0);
|
||||
}, '#secureclosebutton');
|
||||
},
|
||||
|
||||
close: function(url, delay) {
|
||||
/**
|
||||
* Close the secure window, or redirect to URL if the opener is no longer present
|
||||
*
|
||||
* @param {Object} Y YUI instance. When called from renderer, this parameter precedes the others
|
||||
* @param {String} url
|
||||
* @param {Number} delay
|
||||
*/
|
||||
close: function(Y, url, delay) {
|
||||
setTimeout(function() {
|
||||
if (window.opener) {
|
||||
window.opener.document.location.reload();
|
||||
|
Loading…
x
Reference in New Issue
Block a user