mirror of
https://github.com/moodle/moodle.git
synced 2025-07-13 18:36:34 +02:00
MDL-57488 js: remove M.util.focus_login_form/error
These are replaced by some simple jquery instead.
This commit is contained in:
@ -812,42 +812,21 @@ M.util.get_string = function(identifier, component, a) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Set focus on username or password field of the login form
|
||||
* Set focus on username or password field of the login form.
|
||||
* @deprecated since Moodle 3.3.
|
||||
*/
|
||||
M.util.focus_login_form = function(Y) {
|
||||
var username = Y.one('#username');
|
||||
var password = Y.one('#password');
|
||||
|
||||
if (username == null || password == null) {
|
||||
// something is wrong here
|
||||
return;
|
||||
}
|
||||
|
||||
var curElement = document.activeElement
|
||||
if (curElement == 'undefined') {
|
||||
// legacy browser - skip refocus protection
|
||||
} else if (curElement.tagName == 'INPUT') {
|
||||
// user was probably faster to focus something, do not mess with focus
|
||||
return;
|
||||
}
|
||||
|
||||
if (username.get('value') == '') {
|
||||
username.focus();
|
||||
} else {
|
||||
password.focus();
|
||||
}
|
||||
}
|
||||
Y.log('M.util.focus_login_form no longer does anything. Please use jquery instead.', 'warn', 'javascript-static.js');
|
||||
};
|
||||
|
||||
/**
|
||||
* Set focus on login error message
|
||||
* Set focus on login error message.
|
||||
* @deprecated since Moodle 3.3.
|
||||
*/
|
||||
M.util.focus_login_error = function(Y) {
|
||||
var errorlog = Y.one('#loginerrormessage');
|
||||
Y.log('M.util.focus_login_error no longer does anything. Please use jquery instead.', 'warn', 'javascript-static.js');
|
||||
};
|
||||
|
||||
if (errorlog) {
|
||||
errorlog.focus();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Adds lightbox hidden element that covers the whole node.
|
||||
*
|
||||
|
Reference in New Issue
Block a user