summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2018-08-23 00:34:35 +0900
committerGitHub <noreply@github.com>2018-08-23 00:34:35 +0900
commit2b54b4ac06e512c09b335433a9a935db7578fc7f (patch)
tree631e5233124fbc08bebc33fedab29359772e6ec4 /src/client
parentMerge pull request #2402 from acid-chicken/patch-3 (diff)
downloadmisskey-2b54b4ac06e512c09b335433a9a935db7578fc7f.tar.gz
misskey-2b54b4ac06e512c09b335433a9a935db7578fc7f.tar.bz2
misskey-2b54b4ac06e512c09b335433a9a935db7578fc7f.zip
Update url-preview.vue
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/views/components/url-preview.vue20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue
index 95dafa8f4c..655958188e 100644
--- a/src/client/app/common/views/components/url-preview.vue
+++ b/src/client/app/common/views/components/url-preview.vue
@@ -1,5 +1,7 @@
<template>
-<iframe v-if="player" :src="player" heigth="250" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen />
+<div v-if="player.url" class="player" :style="`padding: ${(player.height || 0) / (player.width || 1) * 100}% 0 0`">
+ <iframe :src="player.url" :width="player.width" :heigth="player.height" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen />
+</div>
<div v-else-if="tweetUrl && detail" class="twitter">
<blockquote ref="tweet" class="twitter-tweet" :data-theme="$store.state.device.darkmode ? 'dark' : null">
<a :href="url"></a>
@@ -46,7 +48,11 @@ export default Vue.extend({
thumbnail: null,
icon: null,
sitename: null,
- player: null,
+ player: {
+ url: null,
+ width: null,
+ height: null
+ },
tweetUrl: null,
misskeyUrl
};
@@ -170,9 +176,17 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
-iframe
+.twitter
+ position relative
width 100%
+ > iframe
+ height 100%
+ left 0
+ position absolute
+ top 0
+ width 100%
+
root(isDark)
> a
display block