Permalink
Browse files

Merge branch 'MDL-26337' of git://github.com/timhunt/moodle

  • Loading branch information...
2 parents 3fa0670 + 8711360 commit 2453531f038e19faace0de69fb6dd08f571fe812 @skodak skodak committed Feb 14, 2011
Showing with 4 additions and 16 deletions.
  1. +0 −11 lib/javascript-static.js
  2. +4 −5 lib/weblib.php
View
@@ -1062,17 +1062,6 @@ function close_window(e) {
}
/**
- * Close the current browser window, forcing the window/tab that opened this
- * popup to reload itself. */
-function close_window_reloading_opener() {
- if (window.opener) {
- window.opener.location.reload(1);
- close_window({});
- // Intentionally, only try to close the window if there is some evidence we are in a popup.
- }
-}
-
-/**
* Used in a couple of modules to hide navigation areas when using AJAX
*/
View
@@ -823,13 +823,12 @@ function close_window($delay = 0, $reloadopener = false) {
}
if ($reloadopener) {
- $function = 'close_window_reloading_opener';
- } else {
- $function = 'close_window';
+ // Trigger the reload immediately, even if the reload is after a delay.
+ $PAGE->requires->js_function_call('window.opener.location.reload', array(true));
}
- echo '<p class="centerpara">' . get_string('windowclosing') . '</p>';
+ $OUTPUT->notification(get_string('windowclosing'), 'notifysuccess');
- $PAGE->requires->js_function_call($function, null, false, $delay);
+ $PAGE->requires->js_function_call('close_window', array(new stdClass()), false, $delay);
echo $OUTPUT->footer();
exit;

0 comments on commit 2453531

Please sign in to comment.