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/LdPdfViewer.vue | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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

diff --git a/viewer/src/components/LdPdfViewer.vue b/viewer/src/components/LdPdfViewer.vue
index 20055cc..b1f6c64 100644
--- a/viewer/src/components/LdPdfViewer.vue
+++ b/viewer/src/components/LdPdfViewer.vue
@@ -22,7 +22,7 @@
   <!-- intermediate container necessary to eliminate the double scrollbar -->
   <div class="fill no-scroll">
     <!-- prefer native browser PDF viewer if available -->
-    <object class="fill" :data="itemResourceUrl()" type="application/pdf">
+    <object class="fill" :data="itemResourceUrl" type="application/pdf">
       <!-- TODO: fallback to PDF.js (https://github.com/pacien/ldgallery/issues/212) -->
       <ld-download :item="pdfItem" />
     </object>
@@ -32,15 +32,15 @@
 <script lang="ts">
 import { Component, Prop, Vue } from "vue-property-decorator";
 
-@Component export default class LdPdfViewer extends Vue {
+@Component
+export default class LdPdfViewer extends Vue {
   @Prop({ required: true }) readonly pdfItem!: Gallery.PDF;
 
-  itemResourceUrl(): string {
+  get itemResourceUrl(): string {
     return this.$galleryStore.resourceRoot + this.pdfItem.properties.resource;
   }
 }
 </script>
 
 <style lang="scss" module>
-
 </style>
-- 
cgit v1.2.3

