Permalink
Browse files

Merge pull request #1625 from ajaxorg/cancelupload_bug

fixed issues with cancel upload queue
  • Loading branch information...
2 parents ca4ff6f + e874dfc commit 04537b93aa626331b76d27bf1c7c048d3ce19d00 @zefhemel zefhemel committed Jun 1, 2012
Showing with 15 additions and 7 deletions.
  1. +15 −7 plugins-client/ext.uploadfiles/uploadfiles.js
@@ -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 + ")";
@@ -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);
@@ -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;
@@ -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);

0 comments on commit 04537b9

Please sign in to comment.