Reorganize client shared modules
[oweals/peertube.git] / client / src / app / shared / forms / textarea-autoresize.directive.ts
diff --git a/client/src/app/shared/forms/textarea-autoresize.directive.ts b/client/src/app/shared/forms/textarea-autoresize.directive.ts
deleted file mode 100644 (file)
index f8c855c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// Thanks: https://github.com/evseevdev/ngx-textarea-autosize
-import { AfterViewInit, Directive, ElementRef, HostBinding, HostListener } from '@angular/core'
-
-@Directive({
-  selector: 'textarea[myAutoResize]'
-})
-export class TextareaAutoResizeDirective implements AfterViewInit {
-  @HostBinding('attr.rows') rows = '1'
-  @HostBinding('style.overflow') overflow = 'hidden'
-
-  constructor (private elem: ElementRef) { }
-
-  public ngAfterViewInit () {
-    this.resize()
-  }
-
-  @HostListener('input')
-  resize () {
-    const textarea = this.elem.nativeElement as HTMLTextAreaElement
-    // Reset textarea height to auto that correctly calculate the new height
-    textarea.style.height = 'auto'
-    // Set new height
-    textarea.style.height = `${textarea.scrollHeight}px`
-  }
-}