mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Merge pull request #273 from GruberViktor/dev
Added nav buttons in the document detail view
This commit is contained in:
@@ -34,11 +34,25 @@
|
||||
</svg> <span class="d-none d-lg-inline" i18n>More like this</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" (click)="close()">
|
||||
<button type="button" class="btn btn-sm btn-outline-primary me-2" i18n-title title="Close" (click)="close()">
|
||||
<svg class="buttonicon" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#x" />
|
||||
</svg> <span class="d-none d-lg-inline" i18n>Close</span>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div class="button-group">
|
||||
<button type="button" class="btn btn-sm btn-outline-primary me-2" i18n-title title="Previous" (click)="previousDoc()" [disabled]="!hasPrevious()">
|
||||
<svg class="buttonicon" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#arrow-left" />
|
||||
</svg>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" i18n-title title="Next" (click)="nextDoc()" [disabled]="!hasNext()">
|
||||
<svg class="buttonicon" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#arrow-right" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</app-page-header>
|
||||
|
||||
|
||||
|
@@ -292,6 +292,22 @@ export class DocumentDetailComponent implements OnInit, OnDestroy, DirtyComponen
|
||||
return this.documentListViewService.hasNext(this.documentId)
|
||||
}
|
||||
|
||||
hasPrevious() {
|
||||
return this.documentListViewService.hasPrevious(this.documentId)
|
||||
}
|
||||
|
||||
nextDoc() {
|
||||
this.documentListViewService.getNext(this.document.id).subscribe((nextDocId: number) => {
|
||||
this.router.navigate(['documents', nextDocId])
|
||||
})
|
||||
}
|
||||
|
||||
previousDoc () {
|
||||
this.documentListViewService.getPrevious(this.document.id).subscribe((prevDocId: number) => {
|
||||
this.router.navigate(['documents', prevDocId])
|
||||
})
|
||||
}
|
||||
|
||||
pdfPreviewLoaded(pdf: PDFDocumentProxy) {
|
||||
this.previewNumPages = pdf.numPages
|
||||
}
|
||||
|
Reference in New Issue
Block a user