mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
fix conflict with mobile preview pane
This commit is contained in:
parent
06253ed8f2
commit
1941be8f53
@ -127,9 +127,17 @@
|
|||||||
<li [ngbNavItem]="4" class="d-md-none">
|
<li [ngbNavItem]="4" class="d-md-none">
|
||||||
<a ngbNavLink>Preview</a>
|
<a ngbNavLink>Preview</a>
|
||||||
<ng-template ngbNavContent *ngIf="pdfPreview.offsetParent == undefined">
|
<ng-template ngbNavContent *ngIf="pdfPreview.offsetParent == undefined">
|
||||||
<div class="pdf-viewer-container" *ngIf="getContentType() == 'application/pdf'">
|
<ng-container *ngIf="getContentType() == 'application/pdf'">
|
||||||
<pdf-viewer [src]="previewUrl" [original-size]="false" [show-borders]="true"></pdf-viewer>
|
<div class="preview-sticky pdf-viewer-container" *ngIf="!useNativePdfViewer ; else nativePdfViewer">
|
||||||
</div>
|
<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>
|
</ng-template>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -154,6 +162,5 @@
|
|||||||
<ng-container *ngIf="getContentType() == 'text/plain'">
|
<ng-container *ngIf="getContentType() == 'text/plain'">
|
||||||
<object [data]="previewUrl | safe" type="text/plain" class="preview-sticky bg-white" width="100%"></object>
|
<object [data]="previewUrl | safe" type="text/plain" class="preview-sticky bg-white" width="100%"></object>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -75,8 +75,7 @@ export class DocumentDetailComponent implements OnInit, OnDestroy, DirtyComponen
|
|||||||
@ViewChild('nav') nav: NgbNav
|
@ViewChild('nav') nav: NgbNav
|
||||||
@ViewChild('pdfPreview') set pdfPreview(element) {
|
@ViewChild('pdfPreview') set pdfPreview(element) {
|
||||||
// this gets called when compontent added or removed from DOM
|
// 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));
|
setTimeout(()=> this.nav?.select(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user