diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html index 6f2742a8d..b4783ff24 100644 --- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html +++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.html @@ -1,11 +1,11 @@
- +
- +
diff --git a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts index e3bd4b7f7..f8bb9f518 100644 --- a/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts +++ b/src-ui/src/app/components/document-list/document-card-large/document-card-large.component.ts @@ -15,16 +15,11 @@ export class DocumentCardLargeComponent implements OnInit { @Input() selected = false - setSelected(value: boolean) { - this.selected = value - this.selectedChange.emit(value) - } - @Output() - selectedChange = new EventEmitter() + toggleSelected = new EventEmitter() get selectable() { - return this.selectedChange.observers.length > 0 + return this.toggleSelected.observers.length > 0 } @Input() diff --git a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html index c951bf281..192696a47 100644 --- a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html +++ b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.html @@ -1,11 +1,11 @@
- +
- +
diff --git a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.ts b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.ts index ed69c5c50..5db0e30c0 100644 --- a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.ts +++ b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.ts @@ -14,14 +14,9 @@ export class DocumentCardSmallComponent implements OnInit { @Input() selected = false - - setSelected(value: boolean) { - this.selected = value - this.selectedChange.emit(value) - } - + @Output() - selectedChange = new EventEmitter() + toggleSelected = new EventEmitter() @Input() document: PaperlessDocument diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index 612238215..86aacc031 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -90,7 +90,7 @@
- +
@@ -138,7 +138,7 @@
- +
@@ -170,5 +170,5 @@
- +
diff --git a/src-ui/src/app/components/document-list/document-list.component.ts b/src-ui/src/app/components/document-list/document-list.component.ts index fda99eb8d..1243e6e8a 100644 --- a/src-ui/src/app/components/document-list/document-list.component.ts +++ b/src-ui/src/app/components/document-list/document-list.component.ts @@ -160,6 +160,10 @@ export class DocumentListComponent implements OnInit { this.filterRulesModified = modified } + toggleSelected(document: PaperlessDocument, event: Event): void { + this.list.toggleSelected(document) + } + clickTag(tagID: number) { this.list.selectNone() setTimeout(() => { diff --git a/src-ui/src/app/services/document-list-view.service.ts b/src-ui/src/app/services/document-list-view.service.ts index 1bbcca38e..a852eda55 100644 --- a/src-ui/src/app/services/document-list-view.service.ts +++ b/src-ui/src/app/services/document-list-view.service.ts @@ -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) {