aboutsummaryrefslogtreecommitdiff
path: root/src/components/attachment/attachment.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-11-08 19:48:31 +0200
committerHenry Jameson <me@hjkos.com>2019-11-08 19:48:31 +0200
commit0dcb696e26dfcf97ad46e533ed4797bc9364fc01 (patch)
tree2d7b5e7d43b92eb36a9b170e9c5e32dda5d2b7b4 /src/components/attachment/attachment.js
parent6ade3be5b40816f8765e657442aa2945e51ce7d4 (diff)
parent632773ba91ef021dd589ab4d2037f5e0ed7ca5b2 (diff)
Merge remote-tracking branch 'upstream/develop' into emoji-optimizations
* upstream/develop: (95 commits) Lightbox/modal multi image improvements - #381 '/api/pleroma/profile/mfa' -> '/api/pleroma/accounts/mfa' Add ability to change user's email translations-de-batch-1 eu-translate update profile-banner rounding css, fixes #690 fix indentation remove needless ref show preview popover when hover numbered replies refactor conditions do not make too many nested div add fetchStatus action refactor status loading logic split status preview popover into a separate component uninstall mobile-detect library listen both events minor css fix restrict distance at top side only set different trigger event in desktop and mobile by default fix eslint warnings ...
Diffstat (limited to 'src/components/attachment/attachment.js')
-rw-r--r--src/components/attachment/attachment.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index e93921fe..06b496b0 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -10,13 +10,14 @@ const Attachment = {
'statusId',
'size',
'allowPlay',
- 'setMedia'
+ 'setMedia',
+ 'naturalSizeLoad'
],
data () {
return {
nsfwImage: this.$store.state.instance.nsfwCensorImage || nsfwImage,
- hideNsfwLocal: this.$store.state.config.hideNsfw,
- preloadImage: this.$store.state.config.preloadImage,
+ hideNsfwLocal: this.$store.getters.mergedConfig.hideNsfw,
+ preloadImage: this.$store.getters.mergedConfig.preloadImage,
loading: false,
img: fileTypeService.fileType(this.attachment.mimetype) === 'image' && document.createElement('img'),
modalOpen: false,
@@ -57,7 +58,7 @@ const Attachment = {
}
},
openModal (event) {
- const modalTypes = this.$store.state.config.playVideosInModal
+ const modalTypes = this.$store.getters.mergedConfig.playVideosInModal
? ['image', 'video']
: ['image']
if (fileTypeService.fileMatchesSomeType(modalTypes, this.attachment) ||
@@ -70,7 +71,7 @@ const Attachment = {
}
},
toggleHidden (event) {
- if (this.$store.state.config.useOneClickNsfw && !this.showHidden) {
+ if (this.$store.getters.mergedConfig.useOneClickNsfw && !this.showHidden) {
this.openModal(event)
return
}
@@ -88,6 +89,11 @@ const Attachment = {
} else {
this.showHidden = !this.showHidden
}
+ },
+ onImageLoad (image) {
+ const width = image.naturalWidth
+ const height = image.naturalHeight
+ this.naturalSizeLoad && this.naturalSizeLoad({ width, height })
}
}
}