Small code improvement

pull/297/head
Aleksander Machniak 9 years ago
parent e85bbc9e9c
commit 91ef2c812a

@ -510,8 +510,11 @@ function rcube_webmail()
break; break;
case 'login': case 'login':
var input_user = $('#rcmloginuser'); var tz, tz_name, jstz = window.jstz,
input_user.bind('keyup', function(e){ return ref.login_user_keyup(e); }); input_user = $('#rcmloginuser'),
input_tz = $('#rcmlogintz');
input_user.bind('keyup', function(e) { return ref.login_user_keyup(e); });
if (input_user.val() == '') if (input_user.val() == '')
input_user.focus(); input_user.focus();
@ -519,14 +522,10 @@ function rcube_webmail()
$('#rcmloginpwd').focus(); $('#rcmloginpwd').focus();
// detect client timezone // detect client timezone
if (window.jstz) { if (jstz && (tz = jstz.determine()))
var timezone = jstz.determine(); tz_name = tz.name();
if (timezone.name())
$('#rcmlogintz').val(timezone.name()); input_tz.val(tz_name ? tz_name : (new Date().getStdTimezoneOffset() / -60));
}
else {
$('#rcmlogintz').val(new Date().getStdTimezoneOffset() / -60);
}
// display 'loading' message on form submit, lock submit button // display 'loading' message on form submit, lock submit button
$('form').submit(function () { $('form').submit(function () {

Loading…
Cancel
Save