...
 
Commits (2)
......@@ -177,10 +177,14 @@ const PostStatusForm = {
...mapGetters(['mergedConfig'])
},
methods: {
postStatus (newStatus, opts = {}) {
postStatus (event, newStatus, opts = {}) {
if (this.posting) { return }
if (this.submitDisabled) { return }
if (this.emojiInputShown) { return }
if (this.submitOnEnter) {
event.stopPropagation()
event.preventDefault()
}
if (opts.control && this.submitOnEnter) {
newStatus.status = `${newStatus.status}\n`
return
......
......@@ -96,8 +96,9 @@
:disabled="posting"
class="form-post-body"
:class="{ 'scrollable-form': !!maxHeight }"
@keydown.meta.enter="postStatus(newStatus, { control: true })"
@keyup.ctrl.enter="postStatus(newStatus)"
@keydown.exact.enter="submitOnEnter && postStatus($event, newStatus)"
@keydown.meta.enter="postStatus($event, newStatus, { control: true })"
@keyup.ctrl.enter="postStatus($event, newStatus)"
@drop="fileDrop"
@dragover.prevent="fileDrag"
@input="resize"
......@@ -217,8 +218,8 @@
v-else
:disabled="submitDisabled"
class="btn btn-default"
@touchstart.stop.prevent="postStatus(newStatus)"
@mousedown.stop.prevent="postStatus(newStatus)"
@touchstart.stop.prevent="postStatus($event, newStatus)"
@mousedown.stop.prevent="postStatus($event, newStatus)"
>
{{ $t('general.submit') }}
</button>
......