aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdPlainTextViewer.vue
diff options
context:
space:
mode:
authorZero~Informatique2020-06-19 22:12:03 +0200
committerZero~Informatique2020-06-19 22:12:03 +0200
commit69dc0d20706ed41e5ecdbb77515066d8a7d7703b (patch)
tree8b69fcb1d4a96290134980e75281563f8b4c271e /viewer/src/components/LdPlainTextViewer.vue
parenta053076d692be5e3698fe1a2c071d077cb4b6b73 (diff)
downloadldgallery-69dc0d20706ed41e5ecdbb77515066d8a7d7703b.tar.gz
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
Diffstat (limited to 'viewer/src/components/LdPlainTextViewer.vue')
-rw-r--r--viewer/src/components/LdPlainTextViewer.vue9
1 files changed, 5 insertions, 4 deletions
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 @@
22 <!-- Outer div necessary for the resize handle to appear on Firefox. --> 22 <!-- Outer div necessary for the resize handle to appear on Firefox. -->
23 <div :class="$style.content" class="fill"> 23 <div :class="$style.content" class="fill">
24 <!-- Using an iframe here to let the browser deal with content encoding detection. --> 24 <!-- Using an iframe here to let the browser deal with content encoding detection. -->
25 <iframe class="fill" :src="itemResourceUrl()" /> 25 <iframe class="fill" :src="itemResourceUrl" />
26 </div> 26 </div>
27</template> 27</template>
28 28
29<script lang="ts"> 29<script lang="ts">
30import { Component, Prop, Vue } from "vue-property-decorator"; 30import { Component, Prop, Vue } from "vue-property-decorator";
31 31
32@Component export default class LdPlainTextViewer extends Vue { 32@Component
33export default class LdPlainTextViewer extends Vue {
33 @Prop({ required: true }) readonly plainTextItem!: Gallery.PlainText; 34 @Prop({ required: true }) readonly plainTextItem!: Gallery.PlainText;
34 35
35 itemResourceUrl(): string { 36 get itemResourceUrl(): string {
36 return this.$galleryStore.resourceRoot + this.plainTextItem.properties.resource; 37 return this.$galleryStore.resourceRoot + this.plainTextItem.properties.resource;
37 } 38 }
38} 39}
@@ -46,7 +47,7 @@ import { Component, Prop, Vue } from "vue-property-decorator";
46 resize: horizontal; 47 resize: horizontal;
47 max-width: 100%; // Forbid overflow when resizing. 48 max-width: 100%; // Forbid overflow when resizing.
48 overflow: hidden; // Necessary for the resize handle to be shown in Chromium. 49 overflow: hidden; // Necessary for the resize handle to be shown in Chromium.
49 padding: .5em; // Necessary for the resize handle to be selectable on qutebrowser. 50 padding: 0.5em; // Necessary for the resize handle to be selectable on qutebrowser.
50 51
51 // Re-normalise page colour. 52 // Re-normalise page colour.
52 background-color: white; 53 background-color: white;