diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-09-22 14:14:32 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2018-09-22 14:14:32 +0200 |
commit | 9fe4406794aaa4503d090ca4bfe6872b4e556178 (patch) | |
tree | bfbfa8bbeda724a29ada7709d714220ac449c004 /client/src/app/login | |
parent | cc3d1dce1fc20a1a80745496fbbee9f2536a7948 (diff) | |
download | PeerTube-9fe4406794aaa4503d090ca4bfe6872b4e556178.tar.gz PeerTube-9fe4406794aaa4503d090ca4bfe6872b4e556178.tar.zst PeerTube-9fe4406794aaa4503d090ca4bfe6872b4e556178.zip |
autofocus first field on login
Diffstat (limited to 'client/src/app/login')
-rw-r--r-- | client/src/app/login/login.component.html | 2 | ||||
-rw-r--r-- | client/src/app/login/login.component.ts | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/client/src/app/login/login.component.html b/client/src/app/login/login.component.html index 619150ade..267a2d857 100644 --- a/client/src/app/login/login.component.html +++ b/client/src/app/login/login.component.html | |||
@@ -13,7 +13,7 @@ | |||
13 | <label i18n for="username">User</label> | 13 | <label i18n for="username">User</label> |
14 | <input | 14 | <input |
15 | type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1" | 15 | type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1" |
16 | formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }" | 16 | formControlName="username" [ngClass]="{ 'input-error': formErrors['username'] }" #emailInput |
17 | > | 17 | > |
18 | <a i18n *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account"> | 18 | <a i18n *ngIf="signupAllowed === true" routerLink="/signup" class="create-an-account"> |
19 | or create an account | 19 | or create an account |
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts index 7c0220885..4bae3ae5c 100644 --- a/client/src/app/login/login.component.ts +++ b/client/src/app/login/login.component.ts | |||
@@ -16,6 +16,7 @@ import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | |||
16 | }) | 16 | }) |
17 | 17 | ||
18 | export class LoginComponent extends FormReactive implements OnInit { | 18 | export class LoginComponent extends FormReactive implements OnInit { |
19 | @ViewChild('emailInput') input: ElementRef | ||
19 | @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef | 20 | @ViewChild('forgotPasswordModal') forgotPasswordModal: ElementRef |
20 | @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef | 21 | @ViewChild('forgotPasswordEmailInput') forgotPasswordEmailInput: ElementRef |
21 | 22 | ||
@@ -47,6 +48,8 @@ export class LoginComponent extends FormReactive implements OnInit { | |||
47 | username: this.loginValidatorsService.LOGIN_USERNAME, | 48 | username: this.loginValidatorsService.LOGIN_USERNAME, |
48 | password: this.loginValidatorsService.LOGIN_PASSWORD | 49 | password: this.loginValidatorsService.LOGIN_PASSWORD |
49 | }) | 50 | }) |
51 | |||
52 | this.input.nativeElement.focus() | ||
50 | } | 53 | } |
51 | 54 | ||
52 | login () { | 55 | login () { |