Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Commit

Permalink
display the upload box for further uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
clouless committed Dec 29, 2018
1 parent 007124f commit 9ae26b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/app/services/backend.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export class BackendService {
const kartoffelstampfTerminalOutputEntry: KartoffelstampfTerminalOutputEntry = JSON.parse(event.data);
subject.next(kartoffelstampfTerminalOutputEntry);
};
ws.onerror = function (event) {
console.log('websocket onerror', event);
};
ws.onclose = function (event) {
subject.complete();
};
Expand Down
1 change: 0 additions & 1 deletion src/app/upload-page/upload-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[isActive]="activeStep == 1"
></app-numbered-headline>
<div
*ngIf="activeStep == 1"
class="drop-container"
[class.drop-container---drag-over]="uiStateDragOver"
[class.drop-container---drag-leave]="uiStateDragLeave"
Expand Down
14 changes: 10 additions & 4 deletions src/app/upload-page/upload-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { HttpErrorResponse } from '@angular/common/http';
display:flex;
justify-content: center;
align-items: center;
transition: border-color 0.5s linear;
}`,
`.drop-container---drag-over { border-color: #0DFF0D; }`,
`.drop-container---drag-leave { border-color: #ccc; }`,
Expand Down Expand Up @@ -70,12 +71,17 @@ export class UploadPageComponent implements OnInit, OnDestroy {
}

handleDrop(event: any) {
this.uiStateDragOver = false;
this.uiStateDragLeave = false;
this.uiStateDrop = true;
const self = this;
self.uiStateDragOver = false;
self.uiStateDragLeave = false;
self.uiStateDrop = true;
setTimeout(() => {
self.uiStateDrop = false;
self.uiStateDragLeave = true;
}, 400);
event.stopPropagation();
event.preventDefault();
this.processFileToBase64DataURI(<FileList>event.dataTransfer.files);
self.processFileToBase64DataURI(<FileList>event.dataTransfer.files);
}

handleDragOver(event: Event) {
Expand Down

0 comments on commit 9ae26b9

Please sign in to comment.