Fix lint relative to DragDropDirective

This commit is contained in:
Rigel Kent 2020-04-03 16:56:19 +02:00
parent d57d1d83c6
commit b9177868b3
No known key found for this signature in database
GPG Key ID: 5E53E96A494E452F
3 changed files with 8 additions and 8 deletions

View File

@ -4,27 +4,27 @@ import { Directive, Output, EventEmitter, HostBinding, HostListener } from '@ang
selector: '[dragDrop]' selector: '[dragDrop]'
}) })
export class DragDropDirective { export class DragDropDirective {
@Output() onFileDropped = new EventEmitter<FileList>() @Output() fileDropped = new EventEmitter<FileList>()
@HostBinding('class.dragover') dragover = false @HostBinding('class.dragover') dragover = false
@HostListener('dragover', ['$event']) onDragOver(e: Event) { @HostListener('dragover', ['$event']) onDragOver (e: Event) {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
this.dragover = true this.dragover = true
} }
@HostListener('dragleave', ['$event']) public onDragLeave(e: Event) { @HostListener('dragleave', ['$event']) public onDragLeave (e: Event) {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
this.dragover = false this.dragover = false
} }
@HostListener('drop', ['$event']) public ondrop(e: DragEvent) { @HostListener('drop', ['$event']) public ondrop (e: DragEvent) {
e.preventDefault() e.preventDefault()
e.stopPropagation() e.stopPropagation()
this.dragover = false this.dragover = false
let files = e.dataTransfer.files const files = e.dataTransfer.files
if (files.length > 0) this.onFileDropped.emit(files) if (files.length > 0) this.fileDropped.emit(files)
} }
} }

View File

@ -1,4 +1,4 @@
<div *ngIf="!hasImportedVideo" class="upload-video-container" dragDrop (onFileDropped)="setTorrentFile($event)"> <div *ngIf="!hasImportedVideo" class="upload-video-container" dragDrop (fileDropped)="setTorrentFile($event)">
<div class="first-step-block"> <div class="first-step-block">
<my-global-icon class="upload-icon" iconName="upload"></my-global-icon> <my-global-icon class="upload-icon" iconName="upload"></my-global-icon>

View File

@ -1,4 +1,4 @@
<div *ngIf="!isUploadingVideo" class="upload-video-container" dragDrop (onFileDropped)="setVideoFile($event)"> <div *ngIf="!isUploadingVideo" class="upload-video-container" dragDrop (fileDropped)="setVideoFile($event)">
<div class="first-step-block"> <div class="first-step-block">
<my-global-icon class="upload-icon" iconName="upload"></my-global-icon> <my-global-icon class="upload-icon" iconName="upload"></my-global-icon>