javascript cleanup: MDL-16583 clean up the close_window function in weblib.php.
This commit is contained in:
@@ -731,4 +731,20 @@ collapsible_region.prototype.handle_animation_complete = function() {
|
||||
if (this.collapsed) {
|
||||
this.div.className += ' collapsed';
|
||||
}
|
||||
}
|
||||
|
||||
/** Close the current browser window. */
|
||||
function close_window() {
|
||||
window.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user