Fix lint relative to DragDropDirective
This commit is contained in:
parent
d57d1d83c6
commit
b9177868b3
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue