// fix login - (tabindex, loading, ellipsis)
This commit is contained in:
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
|
.panel-footer
|
||||||
margin: 15px -20px -20px
|
margin: 15px -20px -20px
|
||||||
height: 73px
|
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
|
//components
|
||||||
@import "admin-theme/admin-header"
|
@import "admin-theme/admin-header"
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<a href="#" class="show-forgot-password pull-right" >
|
<a href="#" class="show-forgot-password pull-right" >
|
||||||
{l s='Lost password'}…
|
{l s='Lost password'}
|
||||||
</a>
|
</a>
|
||||||
<label class="control-label" for="passwd">
|
<label class="control-label" for="passwd">
|
||||||
{l s='Password'}
|
{l s='Password'}
|
||||||
@@ -138,16 +138,16 @@
|
|||||||
id="email_forgot"
|
id="email_forgot"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
autofocus="autofocus"
|
autofocus="autofocus"
|
||||||
tabindex="1"
|
tabindex="5"
|
||||||
placeholder="test@example.com" />
|
placeholder="test@example.com" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-footer">
|
<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>
|
<i class="icon-caret-left"></i>
|
||||||
{l s='Back to login'}
|
{l s='Back to login'}
|
||||||
</button>
|
</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>
|
<i class="icon-ok text-success"></i>
|
||||||
{l s='Send'}
|
{l s='Send'}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
+11
-15
@@ -59,18 +59,18 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.show-forgot-password').click(function(e) {
|
$('.show-forgot-password').on('click',function(e) {
|
||||||
// Kill default behaviour
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
displayForgotPassword();
|
displayForgotPassword();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.show-login-form').click(function(e) {
|
$('.show-login-form').on('click',function(e) {
|
||||||
// Kill default behaviour
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
displayLogin();
|
displayLogin();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#email').focus();
|
||||||
|
|
||||||
//Tab-index loop
|
//Tab-index loop
|
||||||
$('form').each(function(){
|
$('form').each(function(){
|
||||||
var list = $(this).find('*[tabindex]').sort(function(a,b){ return a.tabIndex < b.tabIndex ? -1 : 1; }),
|
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();
|
var l = new Object();
|
||||||
function feedbackSubmit() {
|
function feedbackSubmit() {
|
||||||
l = Ladda.create( document.querySelector( 'button[type=submit]' ) );
|
l = Ladda.create( document.querySelector( 'button[type=submit]' ) );
|
||||||
@@ -127,16 +127,17 @@ function doAjaxLogin(redirect) {
|
|||||||
redirect: redirect,
|
redirect: redirect,
|
||||||
stay_logged_in: $('#stay_logged_in:checked').val()
|
stay_logged_in: $('#stay_logged_in:checked').val()
|
||||||
},
|
},
|
||||||
beforeSend: function(){
|
beforeSend: function() {
|
||||||
feedbackSubmit();
|
feedbackSubmit();
|
||||||
l.start();
|
l.start();
|
||||||
},
|
},
|
||||||
success: function(jsonData) {
|
success: function(jsonData) {
|
||||||
if (jsonData.hasErrors)
|
if (jsonData.hasErrors) {
|
||||||
displayErrors(jsonData.errors);
|
displayErrors(jsonData.errors);
|
||||||
l.stop();
|
l.stop();
|
||||||
else
|
} else {
|
||||||
window.location.assign(jsonData.redirect);
|
window.location.assign(jsonData.redirect);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
error: function(XMLHttpRequest, textStatus, errorThrown) {
|
||||||
l.stop();
|
l.stop();
|
||||||
@@ -164,9 +165,9 @@ function doAjaxForgot() {
|
|||||||
email_forgot: $('#email_forgot').val()
|
email_forgot: $('#email_forgot').val()
|
||||||
},
|
},
|
||||||
success: function(jsonData) {
|
success: function(jsonData) {
|
||||||
if (jsonData.hasErrors)
|
if (jsonData.hasErrors) {
|
||||||
displayErrors(jsonData.errors);
|
displayErrors(jsonData.errors);
|
||||||
else {
|
} else {
|
||||||
alert(jsonData.confirm);
|
alert(jsonData.confirm);
|
||||||
$('#forgot_password_form').hide();
|
$('#forgot_password_form').hide();
|
||||||
displayLogin();
|
displayLogin();
|
||||||
@@ -185,9 +186,4 @@ function displayErrors(errors) {
|
|||||||
for (var error in errors) //IE6 bug fix
|
for (var error in errors) //IE6 bug fix
|
||||||
if (error != 'indexOf') str_errors += '<li>' + errors[error] + '</li>';
|
if (error != 'indexOf') str_errors += '<li>' + errors[error] + '</li>';
|
||||||
$('#error').html(str_errors + '</ol>').removeClass('hide').fadeIn('slow');
|
$('#error').html(str_errors + '</ol>').removeClass('hide').fadeIn('slow');
|
||||||
|
|
||||||
|
|
||||||
// $("#login").effect("shake", {
|
|
||||||
// times: 4
|
|
||||||
// }, 100);
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user