diff options
author | Chocobozzz <me@florianbigard.com> | 2021-03-24 13:32:55 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-03-24 18:18:41 +0100 |
commit | a3664dfdc95897075e7b8abd670706e53f5a1ec3 (patch) | |
tree | ed7036e9051abc971d401599676b7df34efa7ced /client/src/app/+login | |
parent | ec99e8486af6aab5a8affa2e7b9088635647b2ce (diff) | |
download | PeerTube-a3664dfdc95897075e7b8abd670706e53f5a1ec3.tar.gz PeerTube-a3664dfdc95897075e7b8abd670706e53f5a1ec3.tar.zst PeerTube-a3664dfdc95897075e7b8abd670706e53f5a1ec3.zip |
Auto focus plugin search input
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 | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/client/src/app/+login/login.component.html b/client/src/app/+login/login.component.html index 3171e5b0f..0167066a0 100644 --- a/client/src/app/+login/login.component.html +++ b/client/src/app/+login/login.component.html | |||
@@ -21,7 +21,7 @@ | |||
21 | <label i18n for="username">User</label> | 21 | <label i18n for="username">User</label> |
22 | <input | 22 | <input |
23 | type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1" | 23 | type="text" id="username" i18n-placeholder placeholder="Username or email address" required tabindex="1" |
24 | formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" #usernameInput | 24 | formControlName="username" class="form-control" [ngClass]="{ 'input-error': formErrors['username'] }" autofocus |
25 | > | 25 | > |
26 | </div> | 26 | </div> |
27 | 27 | ||
diff --git a/client/src/app/+login/login.component.ts b/client/src/app/+login/login.component.ts index af747b7fa..d8ad49081 100644 --- a/client/src/app/+login/login.component.ts +++ b/client/src/app/+login/login.component.ts | |||
@@ -3,9 +3,9 @@ import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angula | |||
3 | import { ActivatedRoute } from '@angular/router' | 3 | import { ActivatedRoute } from '@angular/router' |
4 | import { AuthService, Notifier, RedirectService, UserService } from '@app/core' | 4 | import { AuthService, Notifier, RedirectService, UserService } from '@app/core' |
5 | import { HooksService } from '@app/core/plugins/hooks.service' | 5 | import { HooksService } from '@app/core/plugins/hooks.service' |
6 | import { InstanceAboutAccordionComponent } from '@app/shared/shared-instance' | ||
7 | import { LOGIN_PASSWORD_VALIDATOR, LOGIN_USERNAME_VALIDATOR } from '@app/shared/form-validators/login-validators' | 6 | import { LOGIN_PASSWORD_VALIDATOR, LOGIN_USERNAME_VALIDATOR } from '@app/shared/form-validators/login-validators' |
8 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' | 7 | import { FormReactive, FormValidatorService } from '@app/shared/shared-forms' |
8 | import { InstanceAboutAccordionComponent } from '@app/shared/shared-instance' | ||
9 | import { NgbAccordion, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' | 9 | import { NgbAccordion, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' |
10 | import { RegisteredExternalAuthConfig, ServerConfig } from '@shared/models' | 10 | import { RegisteredExternalAuthConfig, ServerConfig } from '@shared/models' |
11 | 11 | ||
@@ -16,7 +16,6 @@ import { RegisteredExternalAuthConfig, ServerConfig } from '@shared/models' | |||
16 | }) | 16 | }) |
17 | 17 | ||
18 | export class LoginComponent extends FormReactive implements OnInit, AfterViewInit { | 18 | export class LoginComponent extends FormReactive implements OnInit, AfterViewInit { |
19 | @ViewChild('usernameInput', { static: false }) usernameInput: ElementRef | ||
20 | @ViewChild('forgotPasswordModal', { static: true }) forgotPasswordModal: ElementRef | 19 | @ViewChild('forgotPasswordModal', { static: true }) forgotPasswordModal: ElementRef |
21 | 20 | ||
22 | accordion: NgbAccordion | 21 | accordion: NgbAccordion |
@@ -91,10 +90,6 @@ export class LoginComponent extends FormReactive implements OnInit, AfterViewIni | |||
91 | } | 90 | } |
92 | 91 | ||
93 | ngAfterViewInit () { | 92 | ngAfterViewInit () { |
94 | if (this.usernameInput) { | ||
95 | this.usernameInput.nativeElement.focus() | ||
96 | } | ||
97 | |||
98 | this.hooks.runAction('action:login.init', 'login') | 93 | this.hooks.runAction('action:login.init', 'login') |
99 | } | 94 | } |
100 | 95 | ||