From 4d4e6d6bfcba44e2d138b7407897574d0eebc2a1 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Wed, 13 Jul 2011 20:02:58 +0800 Subject: [PATCH] Revert "MDL-23344 fix login form focus" This reverts commit 70b02b12d39fec290439ee38daabc26de4cf450f. --- lib/javascript-static.js | 28 ---------------------------- login/index.php | 2 -- 2 files changed, 30 deletions(-) diff --git a/lib/javascript-static.js b/lib/javascript-static.js index a3d19461890..f8479204633 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -739,34 +739,6 @@ M.util.get_string = function(identifier, component, a) { return stringvalue; }; -/** - * Set focus on username or password field of the login form - */ -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(); - } -} - - //=== old legacy JS code, hopefully to be replaced soon by M.xx.yy and YUI3 code === function checkall() { diff --git a/login/index.php b/login/index.php index 366ab7e5ff0..52d86a564ec 100644 --- a/login/index.php +++ b/login/index.php @@ -341,8 +341,6 @@ if (isloggedin() and !isguestuser()) { echo $OUTPUT->box_end(); } else { include("index_form.html"); - //focus username or password - $PAGE->requires->js_init_call('M.util.focus_login_form', null, true); } echo $OUTPUT->footer();