mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Added nav buttons in the document detail view
Sometimes, when you are looking for a document, you need to go into the document-detail view to read the pdf. To view the next document in the detail view, normally you would go back and then click on the next. Here I added two buttons to the toolbar to traverse throught the documents easily.
This commit is contained in:
@@ -292,6 +292,24 @@ 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])
|
||||
this.titleInput?.focus()
|
||||
})
|
||||
}
|
||||
|
||||
previousDoc () {
|
||||
this.documentListViewService.getPrevious(this.document.id).subscribe((prevDocId: number) => {
|
||||
this.router.navigate(['documents', prevDocId])
|
||||
this.titleInput?.focus()
|
||||
})
|
||||
}
|
||||
|
||||
pdfPreviewLoaded(pdf: PDFDocumentProxy) {
|
||||
this.previewNumPages = pdf.numPages
|
||||
}
|
||||
|
Reference in New Issue
Block a user