Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

hide on card mouseleave

Michael Shamoondcb17f2f2185
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 e689bfcbd..ca27fb697 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,5 +1,5 @@
<div class="col p-2 h-100">
- <div class="card h-100 shadow-sm document-card" [class.card-selected]="selected" [class.popover-hidden]="popoverHidden">
+ <div class="card h-100 shadow-sm document-card" [class.card-selected]="selected" [class.popover-hidden]="popoverHidden" (mouseleave)="mouseLeaveCard()">
<div class="border-bottom doc-img-container" [class.doc-img-background-selected]="selected" (click)="this.toggleSelected.emit($event)">
<img class="card-img doc-img rounded-top" [src]="getThumbUrl()">
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 4725add10..02eb5e0eb 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
@@ -32,9 +32,6 @@ export class DocumentCardSmallComponent implements OnInit {
moreTags: number = null
- @Output()
- showPreview = new EventEmitter<DocumentCardSmallComponent>()
-
@ViewChild('popover') popover: NgbPopover
mouseOnPreview = false
@@ -91,7 +88,6 @@ export class DocumentCardSmallComponent implements OnInit {
if (this.mouseOnPreview) {
// show popover
this.popoverHidden = false
- this.showPreview.emit(this)
} else {
this.popover.close()
}
@@ -102,4 +98,8 @@ export class DocumentCardSmallComponent implements OnInit {
mouseLeavePreview() {
this.mouseOnPreview = false
}
+
+ mouseLeaveCard() {
+ this.popover.close()
+ }
}
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 630395b69..cf954bde8 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
@@ -170,5 +170,5 @@
</table>
<div class="m-n2 row row-cols-paperless-cards" *ngIf="displayMode == 'smallCards'">
- <app-document-card-small [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" (showPreview)="closeAllPopovers($event)" [document]="d" *ngFor="let d of list.documents; trackBy: trackByDocumentId" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)"></app-document-card-small>
+ <app-document-card-small [selected]="list.isSelected(d)" (toggleSelected)="toggleSelected(d, $event)" [document]="d" *ngFor="let d of list.documents; trackBy: trackByDocumentId" (clickTag)="clickTag($event)" (clickCorrespondent)="clickCorrespondent($event)"></app-document-card-small>
</div>
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 e1c2457e6..0d1562c24 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
@@ -12,7 +12,6 @@ import { SavedViewService } from 'src/app/services/rest/saved-view.service';
import { Toast, ToastService } from 'src/app/services/toast.service';
import { FilterEditorComponent } from './filter-editor/filter-editor.component';
import { SaveViewConfigDialogComponent } from './save-view-config-dialog/save-view-config-dialog.component';
-import { DocumentCardSmallComponent } from './document-card-small/document-card-small.component';
@Component({
selector: 'app-document-list',
@@ -42,8 +41,6 @@ export class DocumentListComponent implements OnInit, OnDestroy {
private consumptionFinishedSubscription: Subscription
- @ViewChildren(DocumentCardSmallComponent) smallCards: QueryList<DocumentCardSmallComponent>
-
get isFiltered() {
return this.list.filterRules?.length > 0
}
@@ -207,10 +204,4 @@ export class DocumentListComponent implements OnInit, OnDestroy {
trackByDocumentId(index, item: PaperlessDocument) {
return item.id
}
-
- closeAllPopovers(cardOpening: DocumentCardSmallComponent) {
- this.smallCards.forEach(card => {
- if (card !== cardOpening) card.popover.close()
- })
- }
}