Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Media List Height in CW Content #6099

Merged
merged 2 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/client/components/media-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export default Vue.extend({
default: false
},
// specify the parent element
parentElement: {
type: Object
}
parentElement: {}
},
data() {
return {
Expand Down Expand Up @@ -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;
Expand All @@ -83,6 +81,11 @@ export default Vue.extend({
}
});
}
},
watch: {
parentElement() {
this.size();
}
}
});
</script>
Expand Down
7 changes: 5 additions & 2 deletions src/client/components/note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand All @@ -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"/>
Expand Down Expand Up @@ -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
};
},
Expand Down Expand Up @@ -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() {
Expand Down