Fixed bug that stopped uploading when the dialog was hidden
authorChristos Stathis <chstath@ebs.gr>
Fri, 22 Jun 2012 13:20:54 +0000 (16:20 +0300)
committerChristos Stathis <chstath@ebs.gr>
Fri, 22 Jun 2012 13:20:54 +0000 (16:20 +0300)
src/gr/grnet/pithos/web/client/FileUploadDialog.java

index 0e3ccfe..141d4ba 100644 (file)
@@ -363,8 +363,13 @@ public class FileUploadDialog extends DialogBox {
        private native void clearUploader() /*-{
                var uploader = $wnd.$("#uploader").pluploadQueue();
                var files = uploader.files;
-               while (files.length > 0)
-                       uploader.removeFile(files[0]);
+               var clear = true;
+               for (var i=0; i<files.length; i++)
+                       if (files[i].status == $wnd.plupload.UPLOADING)
+                               clear = false;
+               if (clear)
+                       while (files.length > 0)
+                               uploader.removeFile(files[0]);
        }-*/;
        
        native void setGlobalDropArea() /*-{