mirror of
https://github.com/moodle/moodle.git
synced 2025-07-19 05:11:33 +02:00
MDL-54551 core: touch-up after review
1. Reworded the string. 2. Removed logic handling form data. 3. Do not use window.location.replace.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @since 2.9
|
||||
*/
|
||||
define(['jquery', 'core/config', 'core/log', 'core/yui', 'core/url'], function($, config, Log, Y, URL) {
|
||||
define(['jquery', 'core/config', 'core/log', 'core/url'], function($, config, Log, URL) {
|
||||
|
||||
// Keeps track of when the user leaves the page so we know not to show an error.
|
||||
var unloading = false;
|
||||
@@ -81,13 +81,7 @@ define(['jquery', 'core/config', 'core/log', 'core/yui', 'core/url'], function($
|
||||
if (exception !== null) {
|
||||
// If the user isn't doing anything too important, redirect to the login page.
|
||||
if (exception.errorcode === "servicerequireslogin") {
|
||||
Y.use('moodle-core-formchangechecker', function() {
|
||||
if (!M.core_formchangechecker.get_form_dirty_state()) {
|
||||
// If we reach here, the user isn't editing anything on the page.
|
||||
var loginUrl = URL.relativeUrl("/login/index.php");
|
||||
window.location.replace(loginUrl);
|
||||
}
|
||||
});
|
||||
window.location = URL.relativeUrl("/login/index.php");
|
||||
} else {
|
||||
for (; i < requests.length; i++) {
|
||||
request = requests[i];
|
||||
|
Reference in New Issue
Block a user