mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-73662 mod_quiz: fix initialization arguments to close button.
Co-authored-by: Sergio Rabellino <rabellino@di.unito.it>
This commit is contained in:
parent
fd487cd3f2
commit
7d030bba77
@ -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