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

Commit

Permalink
fix conflict with mobile preview pane
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed Feb 16, 2022
1 parent 06253ed commit 1941be8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,17 @@
<li [ngbNavItem]="4" class="d-md-none">
<a ngbNavLink>Preview</a>
<ng-template ngbNavContent *ngIf="pdfPreview.offsetParent == undefined">
<div class="pdf-viewer-container" *ngIf="getContentType() == 'application/pdf'">
<pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true"></pdf-viewer>
</div>
<ng-container *ngIf="getContentType() == 'application/pdf'">
<div class="preview-sticky pdf-viewer-container" *ngIf="!useNativePdfViewer ; else nativePdfViewer">
<pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true" [show-all]="true" [render-text-mode]="2"></pdf-viewer>
</div>
<ng-template #nativePdfViewer>
<object [data]="previewUrl | safe" class="preview-sticky" width="100%"></object>
</ng-template>
</ng-container>
<ng-container *ngIf="getContentType() == 'text/plain'">
<object [data]="previewUrl | safe" type="text/plain" class="preview-sticky bg-white" width="100%"></object>
</ng-container>
</ng-template>
</li>
</ul>
Expand All @@ -154,6 +162,5 @@
<ng-container *ngIf="getContentType() == 'text/plain'">
<object [data]="previewUrl | safe" type="text/plain" class="preview-sticky bg-white" width="100%"></object>
</ng-container>

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ export class DocumentDetailComponent implements OnInit, OnDestroy, DirtyComponen
@ViewChild('nav') nav: NgbNav
@ViewChild('pdfPreview') set pdfPreview(element) {
// this gets called when compontent added or removed from DOM
if (element && element.nativeElement.offsetParent !== null) { // its visible

if (element && element.nativeElement.offsetParent !== null && this.nav?.activeId == 4) { // its visible
setTimeout(()=> this.nav?.select(1));
}
}
Expand Down

0 comments on commit 1941be8

Please sign in to comment.