AW-432 add click for uploaded file
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
parent
c3a2383b2e
commit
c5d7550750
@ -10,7 +10,8 @@
|
|||||||
<div class="card-block p-3">
|
<div class="card-block p-3">
|
||||||
<ul class="list-unstyled">
|
<ul class="list-unstyled">
|
||||||
<li *ngFor="let file of uploadService.files" class="upload-file busy" [ngClass]="{'done': file.success,'busy':file.success == false,'error': file.error }">
|
<li *ngFor="let file of uploadService.files" class="upload-file busy" [ngClass]="{'done': file.success,'busy':file.success == false,'error': file.error }">
|
||||||
<div><span class="file-name" [attr.title]="file?.fileName">{{file.fileName}}</span><span class="fa fa-times" title="Cancel" (click)="uploadService.cancelFile(file)"></span><span class="fa fa-check"></span></div>
|
<div *ngIf="file.success == false"><span class="file-name" [attr.title]="file?.fileName">{{file.fileName}}</span><span class="fa fa-times" title="Cancel" (click)="uploadService.cancelFile(file)"></span><span class="fa fa-check"></span></div>
|
||||||
|
<div *ngIf="file.success"><a href="#" (click)="handleUploadedFileClick($event,file)" class="file-name" [attr.title]="file?.fileName">{{file.fileName}}</a><span class="fa fa-check"></span></div>
|
||||||
<div class="progress-container"><div class="progress-bar" [style.width]="file.progress+'%'"></div></div>
|
<div class="progress-container"><div class="progress-bar" [style.width]="file.progress+'%'"></div></div>
|
||||||
<div class="errormessage">{{file.errorMessage}}</div>
|
<div class="errormessage">{{file.errorMessage}}</div>
|
||||||
</li>
|
</li>
|
||||||
|
@ -68,6 +68,15 @@ div.card-header span.fa {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.upload-file > div > a.file-name {
|
||||||
|
display: inline-block;
|
||||||
|
width: calc(100% - 20px);
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
.upload-file.busy > div > span.fa-times {
|
.upload-file.busy > div > span.fa-times {
|
||||||
color: theme-color("danger");
|
color: theme-color("danger");
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component, Input, HostListener, ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
|
import { Component, Input,Output, HostListener, ChangeDetectorRef, OnDestroy, OnInit,EventEmitter } from '@angular/core';
|
||||||
import { ResumableFileUploadService, File } from './resumable-file-upload.service';
|
import { ResumableFileUploadService, File } from './resumable-file-upload.service';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
@ -18,6 +18,7 @@ export class ResumableFileUploadComponent implements OnInit, OnDestroy {
|
|||||||
else
|
else
|
||||||
this.uploadService.parentCode = null;
|
this.uploadService.parentCode = null;
|
||||||
}
|
}
|
||||||
|
@Output() onUploadedFileClick:EventEmitter<string> = new EventEmitter();
|
||||||
|
|
||||||
constructor(private cd: ChangeDetectorRef, public uploadService: ResumableFileUploadService) {
|
constructor(private cd: ChangeDetectorRef, public uploadService: ResumableFileUploadService) {
|
||||||
}
|
}
|
||||||
@ -35,6 +36,11 @@ export class ResumableFileUploadComponent implements OnInit, OnDestroy {
|
|||||||
if(this.refreshSub) this.refreshSub.unsubscribe();
|
if(this.refreshSub) this.refreshSub.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleUploadedFileClick(event:MouseEvent,file:File) {
|
||||||
|
event.preventDefault();
|
||||||
|
this.onUploadedFileClick.emit(file.identifier);
|
||||||
|
}
|
||||||
|
|
||||||
//TODO do this with an canunload guard
|
//TODO do this with an canunload guard
|
||||||
@HostListener('window:beforeunload')
|
@HostListener('window:beforeunload')
|
||||||
windowBeforeUnload = function () {
|
windowBeforeUnload = function () {
|
||||||
|
7
src/assets/bootstrap.min.css
vendored
Normal file
7
src/assets/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
|
<link href="assets/bootstrap.min.css" rel="stylesheet">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<app-root></app-root>
|
<app-root></app-root>
|
||||||
|
Loading…
Reference in New Issue
Block a user