Fix being able to paste an image from clipboard

This commit is contained in:
Kana 2017-09-25 19:05:20 -03:00 committed by GitHub
parent 338e827f13
commit 1544f1ca76
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ upload.token = localStorage.token;
upload.maxFileSize;
// add the album var to the upload so we can store the album id in there
upload.album;
upload.myDropzone;
upload.checkIfPublic = function(){
axios.get('/api/check')
@ -131,8 +132,8 @@ upload.prepareDropzone = function(){
'token': upload.token
},
init: function() {
upload.myDropzone = this;
this.on('addedfile', function(file) {
myDropzone = this;
document.getElementById('uploads').style.display = 'block';
});
// add the selected albumid, if an album is selected, as a header
@ -184,7 +185,7 @@ window.addEventListener('paste', function(event) {
var file = new File([blob], "pasted-image."+blob.type.match(/(?:[^\/]*\/)([^;]*)/)[1]);
file.type = blob.type;
console.log(file);
myDropzone.addFile(file);
upload.myDropzone.addFile(file);
}
}
});