Skip to content

Commit

Permalink
Merge pull request #1625 from ajaxorg/cancelupload_bug
Browse files Browse the repository at this point in the history
fixed issues with cancel upload queue
  • Loading branch information
Zef Hemel committed Jun 1, 2012
2 parents ca4ff6f + e874dfc commit 04537b9
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions plugins-client/ext.uploadfiles/uploadfiles.js
Expand Up @@ -451,7 +451,7 @@ module.exports = ext.register("ext/uploadfiles/uploadfiles", {

uploadNextFile: function() {
if (this.cancelAllUploads)
return;
return this.uploadCanceled();

var _self = this;
uploadactivityNumFiles.$ext.innerHTML = "(" + this.totalNumUploads + ")";
Expand Down Expand Up @@ -629,7 +629,7 @@ module.exports = ext.register("ext/uploadfiles/uploadfiles", {

onProgress: function(perc) {
if (this.cancelAllUploads)
return;
return this.uploadCanceled();

if(!this.currentFile) return;
var total = Math.floor(perc * 100);
Expand All @@ -639,10 +639,8 @@ module.exports = ext.register("ext/uploadfiles/uploadfiles", {
},

onComplete: function() {
if (this.cancelAllUploads) {
this.cancelAllUploads = false;
return;
}
if (this.cancelAllUploads)
return this.uploadCanceled();

var _self = this;
var file = this.currentFile;
Expand Down Expand Up @@ -697,14 +695,24 @@ module.exports = ext.register("ext/uploadfiles/uploadfiles", {
this.uploadFiles = [];
this.uploadQueue = [];

mdlUploadActivity.clear();
mdlUploadActivity.load("<data />");
boxUploadActivity.hide();

(davProject.realWebdav || davProject).setAttribute("showhidden", settings.model.queryValue("auto/projecttree/@showhidden"));
if (this.currentFile.treeNode)
apf.xmldb.removeNode(this.currentFile.treeNode);
},

uploadCanceled: function() {
this.uploadInProgress = false;
this.cancelAllUploads = false;
this.existingOverwriteAll = false;
this.existingSkipAll = false;
this.totalNumUploads = 0;
(davProject.realWebdav || davProject).setAttribute("showhidden", settings.model.queryValue("auto/projecttree/@showhidden"));
require("ext/tree/tree").refresh();
},

getFormData: function(file) {
var form = new FormData();
form.append("upload", file);
Expand Down

0 comments on commit 04537b9

Please sign in to comment.