Merge branch 'dev' into feature-bulk-edit

This commit is contained in:
jonaswinkler
2020-12-13 00:52:36 +01:00
14 changed files with 152 additions and 51 deletions

View File

@@ -35,7 +35,7 @@
<div class="row">
<div class="col-xl">
<div class="col mb-4">
<form [formGroup]='documentForm' (ngSubmit)="save()">
@@ -171,11 +171,9 @@
</form>
</div>
<div class="col-xl d-none d-xl-block document-preview">
<object [data]="previewUrl | safe" type="application/pdf" width="100%" height="100%">
<p>Your browser does not support PDFs.
<a href="previewUrl">Download the PDF</a>.</p>
</object>
<div class="col-md-6 col-xl-8 mb-3">
<div class="pdf-viewer-container" *ngIf="getContentType() == 'application/pdf'">
<pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true"></pdf-viewer>
</div>
</div>
</div>
</div>

View File

@@ -1,5 +1,6 @@
.document-preview {
height: calc(100vh - 180px);
.pdf-viewer-container {
height: calc(100vh - 160px);
top: 70px;
position: sticky;
}
background-color: gray;
}

View File

@@ -59,6 +59,10 @@ export class DocumentDetailComponent implements OnInit {
private documentListViewService: DocumentListViewService,
private titleService: Title) { }
getContentType() {
return this.metadata?.has_archive_version ? 'application/pdf' : this.metadata?.original_mime_type
}
ngOnInit(): void {
this.documentForm.valueChanges.subscribe(wow => {
Object.assign(this.document, this.documentForm.value)