Skip to content

Commit

Permalink
small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
nbittich committed Jan 31, 2024
1 parent 98d63d2 commit eff8405
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/app/features/mail/mail-detail/mail-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@
{{ a.originalFilename }}
</button>
<div class="btn-group">
<button class="btn btn-link" *ngIf="isPdf(a)" (click)="openPdfViewer(a)">
<button class="btn btn-link" *ngIf="isPdf(a)" (click)="openPdfViewer($event, a)">
<fa-icon [icon]="['fas', 'file-pdf']" class="text-secondary"></fa-icon>
</button>
<button class="btn btn-link" *ngIf="isImage(a)" (click)="openImageViewer(a)">
<button class="btn btn-link" *ngIf="isImage(a)" (click)="openImageViewer($event, a)">
<fa-icon [icon]="['fas', 'file-image']" class="text-secondary"></fa-icon>
</button>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/app/features/mail/mail-detail/mail-detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export class MailDetailComponent implements OnInit {
ngOnInit(): void {
this.load();
}
openPdfViewer(upl: FileUpload) {
openPdfViewer(evt: any, upl: FileUpload) {
evt.preventDefault();

const ngbModalRef = this.modalService.open(PdfViewerComponent, {
size: 'xl',
scrollable: true,
Expand All @@ -40,10 +42,12 @@ export class MailDetailComponent implements OnInit {
ngbModalRef.componentInstance.title = upl?.originalFilename;
}
downloadAttachment(evt: any, a: FileUpload) {
evt.stopPropagation();
evt.preventDefault();
this.fileService.download(a);
}
openImageViewer(a: FileUpload) {
openImageViewer(evt: any, a: FileUpload) {
evt.preventDefault();

let ngbModalRef = this.modalService.open(ImageViewerComponent, {
size: 'xl',
scrollable: true,
Expand Down

0 comments on commit eff8405

Please sign in to comment.