Revision 78989564
b/src/gr/grnet/pithos/web/client/FileUploadDialog.java | ||
---|---|---|
62 | 62 |
|
63 | 63 |
public static final boolean DONE = true; |
64 | 64 |
|
65 |
Anchor close; |
|
66 |
|
|
65 | 67 |
/** |
66 | 68 |
* The Form element that performs the file upload. |
67 | 69 |
*/ |
... | ... | |
78 | 80 |
protected Folder folder; |
79 | 81 |
|
80 | 82 |
protected Pithos app; |
83 |
|
|
84 |
private boolean inProgress = false; |
|
81 | 85 |
|
82 | 86 |
/** |
83 | 87 |
* The widget's constructor. |
84 | 88 |
*/ |
85 | 89 |
public FileUploadDialog(Pithos _app) { |
86 | 90 |
app = _app; |
87 |
Anchor close = new Anchor("close");
|
|
91 |
close = new Anchor("close"); |
|
88 | 92 |
close.addStyleName("close"); |
89 | 93 |
close.addClickHandler(new ClickHandler() { |
90 | 94 |
|
... | ... | |
188 | 192 |
FilesAdded: function(up, files) { |
189 | 193 |
for (var j=0; j<files.length; j++) |
190 | 194 |
files[j].url = up.path + "/" + files[j].name + "?X-Auth-Token=" + encodeURIComponent(token); |
195 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::setInProgress(Z)(true); |
|
196 |
}, |
|
197 |
|
|
198 |
FilesRemoved: function(up, files) { |
|
199 |
if (up.files.length == 0) |
|
200 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::setInProgress(Z)(false); |
|
201 |
else |
|
202 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::setInProgress(Z)(true); |
|
191 | 203 |
}, |
192 | 204 |
|
193 | 205 |
BeforeUpload: function(up, file) { |
... | ... | |
206 | 218 |
UploadComplete: function(up, files) { |
207 | 219 |
if ($wnd.console && $wnd.console.log) |
208 | 220 |
$wnd.console.log('All files finished'); |
221 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::setInProgress(Z)(false); |
|
209 | 222 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::hideUploadIndicator()(); |
210 | 223 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::refreshFolder()(); |
211 | 224 |
}, |
... | ... | |
243 | 256 |
uploader = createUploader(); |
244 | 257 |
if ($wnd.console && $wnd.console.log) |
245 | 258 |
$wnd.console.log(uploader); |
259 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::setInProgress(Z)(false); |
|
260 |
} |
|
261 |
else { |
|
262 |
dlg.@gr.grnet.pithos.web.client.FileUploadDialog::setInProgress(Z)(true); |
|
246 | 263 |
} |
247 | 264 |
} |
248 | 265 |
uploader.path = path; |
... | ... | |
301 | 318 |
if (isUploading()) |
302 | 319 |
app.showUploadIndicator(); |
303 | 320 |
} |
321 |
|
|
322 |
private void setInProgress(boolean _inProgress) { |
|
323 |
inProgress = _inProgress; |
|
324 |
if (inProgress) |
|
325 |
close.setText("hide"); |
|
326 |
else |
|
327 |
close.setText("close"); |
|
328 |
} |
|
304 | 329 |
} |
Also available in: Unified diff