From a36794fd4f06b5b1f2e4b33f353e821e6fc9f0a9 Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Wed, 25 Aug 2021 23:44:22 -0600 Subject: [PATCH] Improved video preview behavior --- .../unified-file-card.component.html | 4 ++-- .../unified-file-card.component.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/app/components/unified-file-card/unified-file-card.component.html b/src/app/components/unified-file-card/unified-file-card.component.html index 39c8ade..b6137d8 100644 --- a/src/app/components/unified-file-card/unified-file-card.component.html +++ b/src/app/components/unified-file-card/unified-file-card.component.html @@ -1,4 +1,4 @@ -
+
{{(file_obj.type === 'audio' || file_obj.isAudio) ? 'audiotrack' : 'movie'}}    @@ -52,7 +52,7 @@
- Thumbnail + Thumbnail
diff --git a/src/app/components/unified-file-card/unified-file-card.component.ts b/src/app/components/unified-file-card/unified-file-card.component.ts index 354d921..9451a9a 100644 --- a/src/app/components/unified-file-card/unified-file-card.component.ts +++ b/src/app/components/unified-file-card/unified-file-card.component.ts @@ -36,6 +36,7 @@ export class UnifiedFileCardComponent implements OnInit { thumbnailBlobURL = null; streamURL = null; + hide_image = false; // input/output @Input() loading = true; @@ -149,6 +150,20 @@ export class UnifiedFileCardComponent implements OnInit { return fullLocation; } + onMouseOver() { + this.elevated = true; + setTimeout(() => { + if (this.elevated) { + this.hide_image = true; + } + }, 500); + } + + onMouseOut() { + this.elevated = false; + this.hide_image = false; + } + } function fancyTimeFormat(time) {