aboutsummaryrefslogtreecommitdiff
path: root/src/components/attachment/attachment.js
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2019-10-23 16:17:56 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2019-10-23 16:17:56 +0000
commitf5c37231e14a0d55753505ccf7991714e8cf9057 (patch)
tree4b2a10dc58dd0cd5e132eeb84c3137ff222923d0 /src/components/attachment/attachment.js
parentcd956185207aca84666d38f516b6c4b666ee846b (diff)
parentd76b83efc801cfc4bfd7cb0afa7d7289a16ec667 (diff)
Merge branch 'improve-gallery-sizing-logic' into 'develop'
Improve gallery sizing logic See merge request pleroma/pleroma-fe!975
Diffstat (limited to 'src/components/attachment/attachment.js')
-rw-r--r--src/components/attachment/attachment.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index e93921fe..0880bd7f 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -10,7 +10,8 @@ const Attachment = {
'statusId',
'size',
'allowPlay',
- 'setMedia'
+ 'setMedia',
+ 'naturalSizeLoad'
],
data () {
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 })
}
}
}