fixup! feat: add recipient info on the right side of the composer

Signed-off-by: greta <gretadoci@gmail.com>
This commit is contained in:
greta 2024-11-06 15:57:12 +01:00
Родитель 296f673374
Коммит bde6da59db
1 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -184,6 +184,7 @@ export default {
cookedComposerData: undefined, cookedComposerData: undefined,
changed: false, changed: false,
largerModal: false, largerModal: false,
isLargeScreen: window.innerWidth >= 1200,
recipient: { recipient: {
name: '', name: '',
email: '', email: '',
@ -221,7 +222,9 @@ export default {
return this.composerData?.smartReply ?? null return this.composerData?.smartReply ?? null
}, },
modalSize() { modalSize() {
return this.composerData.to && this.composerData.to.length > 0 ? 'full' : (this.largerModal ? 'large' : 'normal') return this.isLargeScreen && this.composerData.to && this.composerData.to.length > 0
? 'full'
: (this.largerModal ? 'large' : 'normal')
}, },
}, },
created() { created() {
@ -235,11 +238,16 @@ export default {
await this.$nextTick() await this.$nextTick()
this.updateCookedComposerData() this.updateCookedComposerData()
await this.openModalSize() await this.openModalSize()
window.addEventListener('resize', this.checkScreenSize)
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('beforeunload', this.onBeforeUnload) window.removeEventListener('beforeunload', this.onBeforeUnload)
window.removeEventListener('resize', this.checkScreenSize)
}, },
methods: { methods: {
checkScreenSize() {
this.isLargeScreen = window.innerWidth >= 1200
},
async openModalSize() { async openModalSize() {
try { try {
const sizePreference = this.$store.getters.getPreference('modalSize') const sizePreference = this.$store.getters.getPreference('modalSize')
@ -625,6 +633,9 @@ export default {
overflow-y: auto; overflow-y: auto;
padding-left: 5px; padding-left: 5px;
border-left: 1px solid #ccc; border-left: 1px solid #ccc;
@media (max-width: 1200px) {
display: none;
}
} }
.modal-content.with-recipient .left-pane { .modal-content.with-recipient .left-pane {