Merge pull request #1651 from h3poteto/iss-1647
closes #1647 Adjust status height when attachments are dropped
This commit is contained in:
commit
9e49e6915f
|
@ -30,6 +30,7 @@ import Mousetrap from 'mousetrap'
|
|||
import ReceiveDrop from './TimelineSpace/ReceiveDrop'
|
||||
import { AccountLoadError } from '@/errors/load'
|
||||
import { TimelineFetchError } from '@/errors/fetch'
|
||||
import { Event } from '~/src/renderer/components/event'
|
||||
|
||||
export default {
|
||||
name: 'timeline-space',
|
||||
|
@ -46,7 +47,7 @@ export default {
|
|||
collapse: state => state.TimelineSpace.SideMenu.collapse
|
||||
}),
|
||||
...mapGetters('TimelineSpace/Modals', ['modalOpened']),
|
||||
shortcutEnabled: function() {
|
||||
shortcutEnabled: function () {
|
||||
return !this.modalOpened
|
||||
}
|
||||
},
|
||||
|
@ -120,12 +121,17 @@ export default {
|
|||
}
|
||||
this.$store.dispatch('TimelineSpace/Modals/NewToot/openModal')
|
||||
this.$store.dispatch('TimelineSpace/Modals/NewToot/incrementMediaCount')
|
||||
this.$store.dispatch('TimelineSpace/Modals/NewToot/uploadImage', file).catch(() => {
|
||||
this.$message({
|
||||
message: this.$t('message.attach_error'),
|
||||
type: 'error'
|
||||
this.$store
|
||||
.dispatch('TimelineSpace/Modals/NewToot/uploadImage', file)
|
||||
.then(() => {
|
||||
Event.$emit('image-uploaded')
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
message: this.$t('message.attach_error'),
|
||||
type: 'error'
|
||||
})
|
||||
})
|
||||
})
|
||||
return false
|
||||
},
|
||||
onDragEnter(e) {
|
||||
|
|
|
@ -146,6 +146,7 @@ import Visibility from '~/src/constants/visibility'
|
|||
import Status from './NewToot/Status'
|
||||
import Poll from './NewToot/Poll'
|
||||
import { NewTootTootLength, NewTootAttachLength, NewTootModalOpen, NewTootBlockSubmit, NewTootPollInvalid } from '@/errors/validations'
|
||||
import { Event } from '~/src/renderer/components/event'
|
||||
|
||||
export default {
|
||||
name: 'new-toot',
|
||||
|
@ -229,6 +230,11 @@ export default {
|
|||
created() {
|
||||
this.$store.dispatch('TimelineSpace/Modals/NewToot/setupLoading')
|
||||
},
|
||||
mounted() {
|
||||
Event.$on('image-uploaded', () => {
|
||||
this.statusHeight = this.statusHeight - this.$refs.preview.offsetHeight
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
newTootModal: function (newState, oldState) {
|
||||
if (!oldState && newState) {
|
||||
|
|
Loading…
Reference in New Issue