Convert selection functions on cards to toggling, let service handle setting selected

Also because we need to capture mouseevents
This commit is contained in:
Michael Shamoon
2021-01-14 10:56:30 -08:00
parent 35b7346d39
commit 1d88b86238
7 changed files with 18 additions and 21 deletions

View File

@@ -255,6 +255,9 @@ export class DocumentListViewService {
} else if (!value) {
this.selected.delete(d.id)
}
toggleSelected(d: PaperlessDocument): void {
if (this.selected.has(d.id)) this.selected.delete(d.id)
else this.selected.add(d.id)
}
constructor(private documentService: DocumentService, private settings: SettingsService, private router: Router) {