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: { methods: {
uploadFile(file) { uploadFile (file) {
const self = this const self = this
const store = this.$store const store = this.$store
const formData = new FormData() const formData = new FormData()
@ -40,10 +40,11 @@ const mediaUpload = {
], ],
watch: { watch: {
'dropFiles': function (fileInfos) { 'dropFiles': function (fileInfos) {
if (!this.uploading) if (!this.uploading) {
this.uploadFile(fileInfos[0]) this.uploadFile(fileInfos[0])
} }
} }
}
} }
export default mediaUpload export default mediaUpload

View file

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

View file

@ -2,7 +2,7 @@
<div class="post-status-form"> <div class="post-status-form">
<form @submit.prevent="postStatus(newStatus)"> <form @submit.prevent="postStatus(newStatus)">
<div class="form-group" > <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>
<div class="attachments"> <div class="attachments">
<div class="attachment" v-for="file in newStatus.files"> <div class="attachment" v-for="file in newStatus.files">