parent
a16bc30f21
commit
a6235ded8c
|
@ -68,12 +68,14 @@
|
|||
} from '../../_actions/autosuggest'
|
||||
import { observe } from 'svelte-extras'
|
||||
import { get } from '../../_utils/lodash-lite'
|
||||
import { on } from '../../_utils/eventBus'
|
||||
|
||||
export default {
|
||||
oncreate () {
|
||||
this.setupSyncFromStore()
|
||||
this.setupSyncToStore()
|
||||
this.setupAutosize()
|
||||
this.setupResize()
|
||||
},
|
||||
ondestroy () {
|
||||
this.teardownAutosize()
|
||||
|
@ -225,6 +227,13 @@
|
|||
})
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
},
|
||||
setupResize () {
|
||||
on('resizeComposeInput', this, realm => {
|
||||
if (realm === this.get().realm) {
|
||||
autosize.update(this.refs.textarea)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
store: () => store,
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
{label}
|
||||
{title}
|
||||
background="var(--main-bg)"
|
||||
on:show="onShow()"
|
||||
>
|
||||
<ComposeBox realm="dialog" autoFocus={true} dialogId={id} />
|
||||
<ComposeBox {realm} autoFocus={true} dialogId={id} />
|
||||
</ModalDialog>
|
||||
<script>
|
||||
import ModalDialog from './ModalDialog.html'
|
||||
import ComposeBox from '../../compose/ComposeBox.html'
|
||||
import { on } from '../../../_utils/eventBus'
|
||||
import { on, emit } from '../../../_utils/eventBus'
|
||||
import { show } from '../helpers/showDialog'
|
||||
import { oncreate as onCreateDialog } from '../helpers/onCreateDialog'
|
||||
import { close } from '../helpers/closeDialog'
|
||||
|
@ -20,16 +21,20 @@
|
|||
onCreateDialog.call(this)
|
||||
},
|
||||
data: () => ({
|
||||
title: void 0
|
||||
title: void 0,
|
||||
realm: 'dialog'
|
||||
}),
|
||||
methods: {
|
||||
show,
|
||||
close,
|
||||
onPostedStatus (realm) {
|
||||
if (realm !== 'dialog') {
|
||||
if (realm !== this.get().realm) {
|
||||
return
|
||||
}
|
||||
this.close()
|
||||
},
|
||||
onShow () {
|
||||
emit('resizeComposeInput', this.get().realm)
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
Loading…
Reference in a new issue