mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
fix for derpie behavior of successmultiple firing for each upload
This commit is contained in:
parent
ca2a0c057b
commit
fe9b051c87
1 changed files with 8 additions and 2 deletions
|
@ -227,6 +227,8 @@
|
||||||
$('#uploadingOverlay').css('display', 'none')
|
$('#uploadingOverlay').css('display', 'none')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allUploadsComplete = false
|
||||||
|
|
||||||
Dropzone.options.uploads = {
|
Dropzone.options.uploads = {
|
||||||
paramName: 'files',
|
paramName: 'files',
|
||||||
maxFilesize: <%= current_site.remaining_space.to_mb %>,
|
maxFilesize: <%= current_site.remaining_space.to_mb %>,
|
||||||
|
@ -235,8 +237,9 @@
|
||||||
dictDefaultMessage: '',
|
dictDefaultMessage: '',
|
||||||
uploadMultiple: true,
|
uploadMultiple: true,
|
||||||
init: function() {
|
init: function() {
|
||||||
this.on("successmultiple", function(file) {
|
this.on("completemultiple", function(file) {
|
||||||
location.reload()
|
if(allUploadsComplete == true)
|
||||||
|
location.reload()
|
||||||
})
|
})
|
||||||
|
|
||||||
this.on("error", function(file, errorMessage) {
|
this.on("error", function(file, errorMessage) {
|
||||||
|
@ -246,6 +249,9 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
this.on("totaluploadprogress", function(progress, totalBytes, totalBytesSent) {
|
this.on("totaluploadprogress", function(progress, totalBytes, totalBytesSent) {
|
||||||
|
if(progress == 100)
|
||||||
|
allUploadsComplete = true
|
||||||
|
|
||||||
showUploadProgress()
|
showUploadProgress()
|
||||||
$('#progressBar').css('display', 'block')
|
$('#progressBar').css('display', 'block')
|
||||||
$('#uploadingProgress').css('width', progress+'%')
|
$('#uploadingProgress').css('width', progress+'%')
|
||||||
|
|
Loading…
Add table
Reference in a new issue