Small style adjustment, add meta-enter posting.

This commit is contained in:
Roger Braun 2017-02-21 21:48:48 +01:00
parent 34a593aa27
commit 892b826df5
3 changed files with 5 additions and 4 deletions

View File

@ -16,7 +16,7 @@ const mediaUpload = {
}
},
methods: {
uploadFile(file) {
uploadFile (file) {
const self = this
const store = this.$store
const formData = new FormData()
@ -40,8 +40,9 @@ const mediaUpload = {
],
watch: {
'dropFiles': function (fileInfos) {
if (!this.uploading)
if (!this.uploading) {
this.uploadFile(fileInfos[0])
}
}
}
}

View File

@ -144,7 +144,7 @@ const PostStatusForm = {
return fileTypeService.fileType(fileInfo.mimetype)
},
fileDrop (e) {
if(e.dataTransfer.files.length > 0) {
if (e.dataTransfer.files.length > 0) {
e.preventDefault() // allow dropping text like before
this.dropFiles = e.dataTransfer.files
}

View File

@ -2,7 +2,7 @@
<div class="post-status-form">
<form @submit.prevent="postStatus(newStatus)">
<div class="form-group" >
<textarea v-model="newStatus.status" placeholder="Just landed in L.A." rows="3" class="form-control" @keyup.ctrl.enter="postStatus(newStatus)" @drop="fileDrop"></textarea>
<textarea v-model="newStatus.status" placeholder="Just landed in L.A." rows="3" class="form-control" @keyup.meta.enter="postStatus(newStatus)" @keyup.ctrl.enter="postStatus(newStatus)" @drop="fileDrop"></textarea>
</div>
<div class="attachments">
<div class="attachment" v-for="file in newStatus.files">