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

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

diff --git a/viewer/src/components/LdPlainTextViewer.vue b/viewer/src/components/LdPlainTextViewer.vue
index 101fd4c..5c32470 100644
--- a/viewer/src/components/LdPlainTextViewer.vue
+++ b/viewer/src/components/LdPlainTextViewer.vue
@@ -22,17 +22,18 @@
   <!-- Outer div necessary for the resize handle to appear on Firefox. -->
   <div :class="$style.content" class="fill">
     <!-- Using an iframe here to let the browser deal with content encoding detection. -->
-    <iframe class="fill" :src="itemResourceUrl()" />
+    <iframe class="fill" :src="itemResourceUrl" />
   </div>
 </template>
 
 <script lang="ts">
 import { Component, Prop, Vue } from "vue-property-decorator";
 
-@Component export default class LdPlainTextViewer extends Vue {
+@Component
+export default class LdPlainTextViewer extends Vue {
   @Prop({ required: true }) readonly plainTextItem!: Gallery.PlainText;
 
-  itemResourceUrl(): string {
+  get itemResourceUrl(): string {
     return this.$galleryStore.resourceRoot + this.plainTextItem.properties.resource;
   }
 }
@@ -46,7 +47,7 @@ import { Component, Prop, Vue } from "vue-property-decorator";
   resize: horizontal;
   max-width: 100%; // Forbid overflow when resizing.
   overflow: hidden; // Necessary for the resize handle to be shown in Chromium.
-  padding: .5em; // Necessary for the resize handle to be selectable on qutebrowser.
+  padding: 0.5em; // Necessary for the resize handle to be selectable on qutebrowser.
 
   // Re-normalise page colour.
   background-color: white;
-- 
cgit v1.2.3

