aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKana <[email protected]>2017-09-25 19:05:20 -0300
committerGitHub <[email protected]>2017-09-25 19:05:20 -0300
commit1544f1ca761d9fdb9d41830e24b17872bd744a10 (patch)
tree2ff8d95c62dfe8a6eab2957474f7b74d92702906
parentAdded thumbnail to meta tags (diff)
downloadhost.fuwn.me-1544f1ca761d9fdb9d41830e24b17872bd744a10.tar.xz
host.fuwn.me-1544f1ca761d9fdb9d41830e24b17872bd744a10.zip
Fix being able to paste an image from clipboard
-rw-r--r--public/js/home.js5
1 files changed, 3 insertions, 2 deletions
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);
}
}
});