diff options
| author | lambadalambda <gitgud@rogerbraun.net> | 2017-02-22 16:31:59 -0500 |
|---|---|---|
| committer | lambadalambda <gitgud@rogerbraun.net> | 2017-02-22 16:31:59 -0500 |
| commit | b9be4708e6c77f0085a5334710a04dcca7ef94e1 (patch) | |
| tree | 4c0ec80ec4f04805ab2b348481a92a554d1ead49 /src/components/post_status_form | |
| parent | ec5d8b9833034604299496a8ae87741c2efa5b7b (diff) | |
| parent | ded2d54ccab9fbf40e0aba258ae98c2017418c95 (diff) | |
Merge branch 'feature/drag_and_drop_for_media_upload' into 'develop'
Proper handling of drag/drop for most platforms
See merge request !28
Diffstat (limited to 'src/components/post_status_form')
| -rw-r--r-- | src/components/post_status_form/post_status_form.js | 3 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.vue | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index d55525bb..42ebcd48 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -148,6 +148,9 @@ const PostStatusForm = { e.preventDefault() // allow dropping text like before this.dropFiles = e.dataTransfer.files } + }, + fileDrag (e) { + e.dataTransfer.dropEffect = 'copy'; } } } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index eceef4a2..d345ec13 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -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.meta.enter="postStatus(newStatus)" @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" @dragover.prevent="fileDrag"></textarea> </div> <div class="attachments"> <div class="attachment" v-for="file in newStatus.files"> |
