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 a6ac18b83..e689bfcbd 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 @@
-
+
@@ -48,10 +48,10 @@
-
+
Loading...
- +
diff --git a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.scss b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.scss index ba3a180c7..089072135 100644 --- a/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.scss +++ b/src-ui/src/app/components/document-list/document-card-small/document-card-small.component.scss @@ -52,3 +52,8 @@ z-index: 0; } } + +.popover-hidden ::ng-deep .popover { + opacity: 0; + pointer-events: none; +} 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 a19e19533..4725add10 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 @@ -37,6 +37,9 @@ export class DocumentCardSmallComponent implements OnInit { @ViewChild('popover') popover: NgbPopover + mouseOnPreview = false + popoverHidden = true + metadata: PaperlessDocumentMetadata ngOnInit(): void { @@ -81,10 +84,16 @@ export class DocumentCardSmallComponent implements OnInit { mouseEnterPreview() { this.mouseOnPreview = true if (!this.popover.isOpen()) { + // we're going to open but hide to pre-load content during hover delay + this.popover.open() + this.popoverHidden = true setTimeout(() => { if (this.mouseOnPreview) { + // show popover + this.popoverHidden = false this.showPreview.emit(this) - this.popover.open() + } else { + this.popover.close() } }, 600); }