summaryrefslogtreecommitdiff
path: root/src/client/components
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2020-04-16 01:04:21 +0900
committerGitHub <noreply@github.com>2020-04-16 01:04:21 +0900
commitd02e14cb94e792915bdbd7034d8dee3ee8fab4b2 (patch)
tree6c410cd006f258dc9505e9539c631000896bca0e /src/client/components
parentリアクションの修正 (#6260) (diff)
downloadsharkey-d02e14cb94e792915bdbd7034d8dee3ee8fab4b2.tar.gz
sharkey-d02e14cb94e792915bdbd7034d8dee3ee8fab4b2.tar.bz2
sharkey-d02e14cb94e792915bdbd7034d8dee3ee8fab4b2.zip
Fix Media List in CW Content (#6099)
Diffstat (limited to 'src/client/components')
-rw-r--r--src/client/components/media-list.vue11
-rw-r--r--src/client/components/note.vue7
2 files changed, 12 insertions, 6 deletions
diff --git a/src/client/components/media-list.vue b/src/client/components/media-list.vue
index 2c5df4ecaa..c757d80911 100644
--- a/src/client/components/media-list.vue
+++ b/src/client/components/media-list.vue
@@ -34,9 +34,7 @@ export default Vue.extend({
default: false
},
// specify the parent element
- parentElement: {
- type: Object
- }
+ parentElement: {}
},
data() {
return {
@@ -69,7 +67,7 @@ export default Vue.extend({
if (this.$refs.gridOuter) {
let height = 287;
- const parent = this.$props.parentElement || this.$parent.$el;
+ const parent = this.parentElement || this.$parent.$el;
if (this.$refs.gridOuter.clientHeight) {
height = this.$refs.gridOuter.clientHeight;
@@ -83,6 +81,11 @@ export default Vue.extend({
}
});
}
+ },
+ watch: {
+ parentElement() {
+ this.size();
+ }
}
});
</script>
diff --git a/src/client/components/note.vue b/src/client/components/note.vue
index a39520fb4c..34871ac857 100644
--- a/src/client/components/note.vue
+++ b/src/client/components/note.vue
@@ -33,7 +33,7 @@
<mk-avatar class="avatar" :user="appearNote.user"/>
<div class="main">
<x-note-header class="header" :note="appearNote" :mini="true"/>
- <div class="body" v-if="appearNote.deletedAt == null">
+ <div class="body" v-if="appearNote.deletedAt == null" ref="noteBody">
<p v-if="appearNote.cw != null" class="cw">
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" />
<x-cw-button v-model="showContent" :note="appearNote"/>
@@ -46,7 +46,7 @@
<a class="rp" v-if="appearNote.renote != null">RN:</a>
</div>
<div class="files" v-if="appearNote.files.length > 0">
- <x-media-list :media-list="appearNote.files"/>
+ <x-media-list :media-list="appearNote.files" :parent-element="noteBody"/>
</div>
<x-poll v-if="appearNote.poll" :note="appearNote" ref="pollViewer"/>
<mk-url-preview v-for="url in urls" :url="url" :key="url" :compact="true" class="url-preview"/>
@@ -142,6 +142,7 @@ export default Vue.extend({
replies: [],
showContent: false,
hideThisNote: false,
+ noteBody: this.$refs.noteBody,
faEdit, faBolt, faTimes, faBullhorn, faPlus, faMinus, faRetweet, faReply, faReplyAll, faEllipsisH, faHome, faUnlock, faEnvelope, faThumbtack, faBan
};
},
@@ -254,6 +255,8 @@ export default Vue.extend({
if (this.$store.getters.isSignedIn) {
this.connection.on('_connected_', this.onStreamConnected);
}
+
+ this.noteBody = this.$refs.noteBody
},
beforeDestroy() {