aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/angular
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-03-24 13:32:55 +0100
committerChocobozzz <me@florianbigard.com>2021-03-24 18:18:41 +0100
commita3664dfdc95897075e7b8abd670706e53f5a1ec3 (patch)
treeed7036e9051abc971d401599676b7df34efa7ced /client/src/app/shared/shared-main/angular
parentec99e8486af6aab5a8affa2e7b9088635647b2ce (diff)
downloadPeerTube-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.ts12
-rw-r--r--client/src/app/shared/shared-main/angular/index.ts1
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 @@
1import { AfterViewInit, Directive, ElementRef } from '@angular/core'
2
3@Directive({
4 selector: '[autofocus]'
5})
6export 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 @@
1export * from './autofocus.directive'
1export * from './bytes.pipe' 2export * from './bytes.pipe'
2export * from './duration-formatter.pipe' 3export * from './duration-formatter.pipe'
3export * from './from-now.pipe' 4export * from './from-now.pipe'