mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 17:17:26 +01:00
Pre-load pdf contents
This commit is contained in:
parent
4a471138b2
commit
b0fed61a01
3 changed files with 18 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue