Browse Source

Dismiss login failed message when any key is pressed. Fixes #114

sisyphus
Dustin Falgout 8 years ago
parent
commit
7c60cb46e1
No known key found for this signature in database
GPG Key ID: AEA529BF122902E5
  1. 22
      themes/default/js/greeter.js

22
themes/default/js/greeter.js vendored

@ -376,6 +376,7 @@ class Theme {
this.tux = 'img/antergos-logo-user.png';
this.user_list_visible = false;
this.auth_pending = false;
this.showing_message = false;
this.selected_user = null;
this.$user_list = $( '#user-list2' );
this.$session_list = $( '#sessions' );
@ -718,6 +719,7 @@ class Theme {
} else {
// The user did not enter the correct password. Show error message.
this.showing_message = true;
this.show_message( err_msg, 'error' );
}
}
@ -748,11 +750,16 @@ class Theme {
key_press_handler( event ) {
let action;
let action = this.showing_message ? this.dismiss_message : null;
if ( null === action ) {
switch ( event.which ) {
case 13:
action = this.auth_pending ? this.submit_password : ! this.user_list_visible ? this.show_user_list : null;
if ( this.auth_pending ) {
action = this.submit_password;
} else if ( ! this.user_list_visible ) {
action = this.show_user_list;
}
break;
case 27:
action = this.auth_pending ? this.cancel_authentication : null;
@ -760,9 +767,7 @@ class Theme {
case 32:
action = ( !this.user_list_visible && !this.auth_pending ) ? this.show_user_list : null;
break;
default:
action = null;
break;
}
}
if ( null !== action ) {
@ -853,6 +858,13 @@ class Theme {
$( '#collapseTwo .user-wrap2' ).hide();
this.$msg_area_container.show();
}
dismiss_message() {
this.$msg_area_container
.children( '.alert-dismissible' )
.find('.close')
.trigger('click');
}
}

Loading…
Cancel
Save