From 67ed6552b831df66713bac9e672738796128d33f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Jun 2020 14:10:17 +0200 Subject: Reorganize client shared modules --- .../shared/forms/textarea-autoresize.directive.ts | 25 ---------------------- 1 file changed, 25 deletions(-) delete mode 100644 client/src/app/shared/forms/textarea-autoresize.directive.ts (limited to '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 index f8c855c16..000000000 --- a/client/src/app/shared/forms/textarea-autoresize.directive.ts +++ /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` - } -} -- cgit v1.2.3