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 | |
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')
-rw-r--r-- | client/src/app/shared/shared-main/angular/autofocus.directive.ts | 12 | ||||
-rw-r--r-- | client/src/app/shared/shared-main/angular/index.ts | 1 |
2 files changed, 13 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 | } | ||
diff --git a/client/src/app/shared/shared-main/angular/index.ts b/client/src/app/shared/shared-main/angular/index.ts index 29f8b3650..8ea47bb33 100644 --- a/client/src/app/shared/shared-main/angular/index.ts +++ b/client/src/app/shared/shared-main/angular/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './autofocus.directive' | ||
1 | export * from './bytes.pipe' | 2 | export * from './bytes.pipe' |
2 | export * from './duration-formatter.pipe' | 3 | export * from './duration-formatter.pipe' |
3 | export * from './from-now.pipe' | 4 | export * from './from-now.pipe' |