Update ComposeModal.vue, added a caption counter. Fixes #1722

This commit is contained in:
Daniel Supernault 2019-10-08 22:56:38 -06:00
parent 72db2b35b5
commit 009c6ee820
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -110,7 +110,8 @@
<div class="media-body">
<div class="form-group">
<label class="font-weight-bold text-muted small d-none">Caption</label>
<textarea class="form-control border-0 rounded-0 no-focus" rows="2" placeholder="Write a caption..." style="resize:none" v-model="composeText"></textarea>
<textarea class="form-control border-0 rounded-0 no-focus" rows="2" placeholder="Write a caption..." style="resize:none" v-model="composeText" v-on:keyup="composeTextLength = composeText.length"></textarea>
<p class="help-text small text-right text-muted mb-0">{{composeTextLength}}/{{config.uploader.max_caption_length}}</p>
</div>
</div>
</div>
@ -474,9 +475,11 @@ export default {
},
mediaDragAndDrop() {
let self = this;
let pdz = document.getElementById('content');
function allowDrag(e) {
e.dataTransfer.dropEffect = 'copy';
e.preventDefault();
@ -484,10 +487,10 @@ export default {
function handleDrop(e) {
e.preventDefault();
let dz = document.querySelector('#pf-dz');
dz.files = e.dataTransfer.files;
$('#composeModal').modal('show');
self.mediaUpload();
// let dz = document.querySelector('#pf-dz');
// dz.files = e.dataTransfer.files;
// $('#composeModal').modal('show');
// self.mediaUpload();
}
window.addEventListener('dragenter', function(e) {