From 69dc0d20706ed41e5ecdbb77515066d8a7d7703b Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 19 Jun 2020 22:12:03 +0200
Subject: viewer: code update (no functional change)

Types { [x: T]: R } updated to Record<T, R>
Methods in template updated to getters (computed in VueJS), which are reactive and cached
Code formatting
---
 viewer/src/components/LdVideoViewer.vue | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

(limited to 'viewer/src/components/LdVideoViewer.vue')

diff --git a/viewer/src/components/LdVideoViewer.vue b/viewer/src/components/LdVideoViewer.vue
index 49f687f..b7a7c35 100644
--- a/viewer/src/components/LdVideoViewer.vue
+++ b/viewer/src/components/LdVideoViewer.vue
@@ -21,7 +21,13 @@
 <template>
   <!-- intermediate container necessary to eliminate the scrollbar -->
   <div class="fill no-scroll">
-    <video class="fill" :src="itemResourceUrl()" :poster="thumbnailResourceUrl()" preload="auto" controls>
+    <video
+      class="fill"
+      :src="itemResourceUrl"
+      :poster="thumbnailResourceUrl"
+      preload="auto"
+      controls
+    >
       <ld-download :item="videoItem" />
     </video>
   </div>
@@ -30,21 +36,19 @@
 <script lang="ts">
 import { Component, Prop, Vue } from "vue-property-decorator";
 
-@Component export default class LdVideoViewer extends Vue {
+@Component
+export default class LdVideoViewer extends Vue {
   @Prop({ required: true }) readonly videoItem!: Gallery.Video;
 
-  itemResourceUrl(): string {
+  get itemResourceUrl(): string {
     return this.$galleryStore.resourceRoot + this.videoItem.properties.resource;
   }
 
-  thumbnailResourceUrl(): string {
-    return this.videoItem.thumbnail
-      ? this.$galleryStore.resourceRoot + this.videoItem.thumbnail.resource
-      : "";
+  get thumbnailResourceUrl(): string {
+    return this.videoItem.thumbnail ? this.$galleryStore.resourceRoot + this.videoItem.thumbnail.resource : "";
   }
 }
 </script>
 
 <style lang="scss" module>
-
 </style>
-- 
cgit v1.2.3

