Created
July 19, 2017 15:30
-
-
Save fsuuaas/f119857f3de9d7ab139d32058a0a169c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dropzone.options.uploadImages = { | |
autoProcessQueue: false, | |
maxFilesize: 2048, | |
uploadMultiple: false, | |
parallelUploads: 100, | |
acceptedFiles: 'image/*', | |
addRemoveLinks: true, | |
dictRemoveFile: 'Remove', | |
init: function() { | |
var submitButton = document.querySelector("#submit-images") | |
addImages = this; // closure | |
submitButton.addEventListener("click", function(e) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
addImages.processQueue(); // Tell Dropzone to process all queued files. | |
}); | |
this.on("addedfile", function(file) { | |
// Show submit button here and/or inform user to click it. | |
}); | |
this.on("success", function() { | |
if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) { | |
window.location.href = 'http://localhost:8000/user/orders/manage/'; | |
} | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment