Fix: use update preview component for dashboard widget

This commit is contained in:
shamoon
2024-12-04 23:14:08 -08:00
parent 0c883d064e
commit 8722ff481c
5 changed files with 6 additions and 90 deletions

View File

@@ -202,55 +202,10 @@ export class SavedViewWidgetComponent
this.router.navigate(['documents', document.id])
}
getPreviewUrl(document: Document): string {
return this.documentService.getPreviewUrl(document.id)
}
getDownloadUrl(document: Document): string {
return this.documentService.getDownloadUrl(document.id)
}
mouseEnterPreviewButton(doc: Document) {
const newPopover = this.popovers.get(this.documents.indexOf(doc))
if (this.popover !== newPopover && this.popover?.isOpen())
this.popover.close()
this.popover = newPopover
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
} else {
this.popover.close()
}
}, 600)
}
}
mouseEnterPreview() {
this.mouseOnPreview = true
}
mouseLeavePreview() {
this.mouseOnPreview = false
this.maybeClosePopover()
}
mouseLeavePreviewButton() {
this.mouseOnPreview = false
this.maybeClosePopover()
}
maybeClosePopover() {
setTimeout(() => {
if (!this.mouseOnPreview) this.popover?.close()
}, 300)
}
public getColumnTitle(field: DisplayField): string {
if (field.startsWith(DisplayField.CUSTOM_FIELD)) {
const id = field.split('_')[2]