Allow closing individual documents from sidebar

This commit is contained in:
Michael Shamoon
2021-02-25 07:43:02 -08:00
parent 66f7ae3773
commit 548b1ea7ec
4 changed files with 51 additions and 7 deletions

View File

@@ -77,6 +77,20 @@ export class AppFrameComponent implements OnInit {
this.router.navigate(['search'], {queryParams: {query: this.searchField.value}})
}
closeDocument(d: PaperlessDocument) {
this.closeMenu()
this.openDocumentsService.closeDocument(d)
// TODO: is there a better way to do this? (taken from closeAll)
let route = this.activatedRoute
while (route.firstChild) {
route = route.firstChild
}
if (route.component == DocumentDetailComponent) {
this.router.navigate([""])
}
}
closeAll() {
this.closeMenu()
this.openDocumentsService.closeAll()