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/shared/shared-main/angular/autofocus.directive.ts | |
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/shared/shared-main/angular/autofocus.directive.ts')
-rw-r--r-- | client/src/app/shared/shared-main/angular/autofocus.directive.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-main/angular/autofocus.directive.ts b/client/src/app/shared/shared-main/angular/autofocus.directive.ts new file mode 100644 index 000000000..5f087d79d --- /dev/null +++ b/client/src/app/shared/shared-main/angular/autofocus.directive.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | import { AfterViewInit, Directive, ElementRef } from '@angular/core' | ||
2 | |||
3 | @Directive({ | ||
4 | selector: '[autofocus]' | ||
5 | }) | ||
6 | export class AutofocusDirective implements AfterViewInit { | ||
7 | constructor (private host: ElementRef) { } | ||
8 | |||
9 | ngAfterViewInit () { | ||
10 | this.host.nativeElement.focus() | ||
11 | } | ||
12 | } | ||