diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 41730720..16114c30 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -13,6 +13,7 @@ const Attachment = { return { nsfwImage, hideNsfwLocal: this.$store.state.config.hideNsfw, + preloadImage: this.$store.state.config.preloadImage, loopVideo: this.$store.state.config.loopVideo, showHidden: false, loading: false, @@ -46,7 +47,7 @@ const Attachment = { } }, toggleHidden () { - if (this.img) { + if (this.img && !this.preloadImage) { if (this.img.onload) { this.img.onload() } else { diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 40e2cf1b..5eaa0d1d 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -9,8 +9,7 @@
Hide
- - + @@ -161,6 +160,10 @@ display: flex; flex: 1; + &.hidden { + display: none; + } + .still-image { width: 100%; height: 100%; diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 19bd2e5b..c9e12708 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -14,6 +14,7 @@ const settings = { hideAttachmentsInConvLocal: user.hideAttachmentsInConv, hideNsfwLocal: user.hideNsfw, hideISPLocal: user.hideISP, + preloadImage: user.preloadImage, hidePostStatsLocal: typeof user.hidePostStats === 'undefined' ? instance.hidePostStats : user.hidePostStats, @@ -84,6 +85,9 @@ const settings = { hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, + preloadImage (value) { + this.$store.dispatch('setOption', { name: 'preloadImage', value }) + }, hideISPLocal (value) { this.$store.dispatch('setOption', { name: 'hideISP', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index dec33505..6cdc82da 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -118,6 +118,12 @@ +
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index 97dfcb77..92429e4b 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -125,6 +125,7 @@ "hide_attachments_in_convo": "Hide attachments in conversations", "hide_attachments_in_tl": "Hide attachments in timeline", "hide_isp": "Hide instance-specific panel", + "preload_images": "Preload images", "hide_post_stats": "Hide post statistics (e.g. the number of favorites)", "hide_user_stats": "Hide user statistics (e.g. the number of followers)", "import_followers_from_a_csv_file": "Import follows from a csv file", diff --git a/src/modules/config.js b/src/modules/config.js index 45ac8f65..72839476 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -9,6 +9,7 @@ const defaultState = { hideAttachments: false, hideAttachmentsInConv: false, hideNsfw: true, + preloadImage: true, loopVideo: true, loopVideoSilentOnly: true, autoLoad: true,