// fix login - (tabindex, loading, ellipsis)

This commit is contained in:
Kevin Granger
2013-10-25 14:58:10 +02:00
parent 59a1105fce
commit 339f428c23
4 changed files with 19 additions and 25 deletions
File diff suppressed because one or more lines are too long
@@ -116,12 +116,10 @@ input[type="text"],input[type="search"],input[type="password"], textarea, select
.panel-footer
margin: 15px -20px -20px
height: 73px
.panel-footer
.btn.pull-right
margin-left: 3px
//todo: fix focus firefox
*:focus
outline: none!important
-moz-outline: none!important
-moz-user-focus: ignore!important
//components
@import "admin-theme/admin-header"
@@ -79,7 +79,7 @@
</div>
<div class="form-group">
<a href="#" class="show-forgot-password pull-right" >
{l s='Lost password'}&hellip;
{l s='Lost password'}
</a>
<label class="control-label" for="passwd">
{l s='Password'}
@@ -138,16 +138,16 @@
id="email_forgot"
class="form-control"
autofocus="autofocus"
tabindex="1"
tabindex="5"
placeholder="test@example.com" />
</div>
</div>
<div class="panel-footer">
<button href="#" class="btn btn-default show-login-form" tabindex="3">
<button href="#" class="btn btn-default show-login-form" tabindex="7">
<i class="icon-caret-left"></i>
{l s='Back to login'}
</button>
<button class="btn btn-default pull-right" name="submitLogin" type="submit" tabindex="2">
<button class="btn btn-default pull-right" name="submitLogin" type="submit" tabindex="6">
<i class="icon-ok text-success"></i>
{l s='Send'}
</button>
+11 -15
View File
@@ -59,18 +59,18 @@ $(document).ready(function() {
}
});
$('.show-forgot-password').click(function(e) {
// Kill default behaviour
$('.show-forgot-password').on('click',function(e) {
e.preventDefault();
displayForgotPassword();
});
$('.show-login-form').click(function(e) {
// Kill default behaviour
$('.show-login-form').on('click',function(e) {
e.preventDefault();
displayLogin();
});
$('#email').focus();
//Tab-index loop
$('form').each(function(){
var list = $(this).find('*[tabindex]').sort(function(a,b){ return a.tabIndex < b.tabIndex ? -1 : 1; }),
@@ -84,7 +84,7 @@ $(document).ready(function() {
});
});
//todo: ladda init - move to top
//todo: ladda init
var l = new Object();
function feedbackSubmit() {
l = Ladda.create( document.querySelector( 'button[type=submit]' ) );
@@ -127,16 +127,17 @@ function doAjaxLogin(redirect) {
redirect: redirect,
stay_logged_in: $('#stay_logged_in:checked').val()
},
beforeSend: function(){
beforeSend: function() {
feedbackSubmit();
l.start();
},
success: function(jsonData) {
if (jsonData.hasErrors)
if (jsonData.hasErrors) {
displayErrors(jsonData.errors);
l.stop();
else
} else {
window.location.assign(jsonData.redirect);
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
l.stop();
@@ -164,9 +165,9 @@ function doAjaxForgot() {
email_forgot: $('#email_forgot').val()
},
success: function(jsonData) {
if (jsonData.hasErrors)
if (jsonData.hasErrors) {
displayErrors(jsonData.errors);
else {
} else {
alert(jsonData.confirm);
$('#forgot_password_form').hide();
displayLogin();
@@ -185,9 +186,4 @@ function displayErrors(errors) {
for (var error in errors) //IE6 bug fix
if (error != 'indexOf') str_errors += '<li>' + errors[error] + '</li>';
$('#error').html(str_errors + '</ol>').removeClass('hide').fadeIn('slow');
// $("#login").effect("shake", {
// times: 4
// }, 100);
}