From 1544f1ca761d9fdb9d41830e24b17872bd744a10 Mon Sep 17 00:00:00 2001 From: Kana <7425261+Pitu@users.noreply.github.com> Date: Mon, 25 Sep 2017 19:05:20 -0300 Subject: Fix being able to paste an image from clipboard --- public/js/home.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'public/js') diff --git a/public/js/home.js b/public/js/home.js index 2ec27e7..4412ac5 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -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); } } }); -- cgit v1.2.3