dropzone
This commit is contained in:
parent
f10b3e71aa
commit
17a65967fc
|
|
@ -133,40 +133,7 @@
|
|||
|
||||
|
||||
{% put scripts %}
|
||||
<script>
|
||||
Dropzone.options.uploadWidget = {
|
||||
paramName: 'file',
|
||||
maxFilesize: 2, // MB
|
||||
maxFiles: 1,
|
||||
dictDefaultMessage: 'Drag an image here to upload, or click to select one',
|
||||
headers: {
|
||||
'x-csrf-token': document.querySelectorAll('meta[name=csrf-token]')[0].getAttributeNode('content').value,
|
||||
},
|
||||
acceptedFiles: 'image/*',
|
||||
init: function () {
|
||||
this.on('success', function (file, resp) {
|
||||
console.log(file);
|
||||
console.log(resp);
|
||||
});
|
||||
this.on('thumbnail', function (file) {
|
||||
if (file.accepted !== false) {
|
||||
if (file.width < 640 || file.height < 480) {
|
||||
file.rejectDimensions();
|
||||
}
|
||||
else {
|
||||
file.acceptDimensions();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
accept: function (file, done) {
|
||||
file.acceptDimensions = done;
|
||||
file.rejectDimensions = function () {
|
||||
done('The image must be at least 640 x 480px')
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<script src="{{'assets/seller/js/ckeditor-classic.js'|theme}}"></script>
|
||||
<script>
|
||||
function getFile(fileq) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue