Skip to content

Commit

Permalink
fixed progress error
Browse files Browse the repository at this point in the history
  • Loading branch information
qawemlilo committed Dec 6, 2011
1 parent 7d8fdf4 commit 18f7f80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Author: Qawelesizwe Mlilo
Email: qawemlilo@gmail.com
Description: Customized Simple SWFUpload Demo
Demo:
Demo: http://qawemlilo.github.com/customized-swfupload/
**********************************************************
*/

Expand Down
17 changes: 8 additions & 9 deletions swfupload/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,7 @@ function uploadProgress(file, bytesLoaded, bytesTotal) {
*/
function uploadSuccess(file, serverData) {
try {
var progress;

FILEObject.uploadedFiles += 1;

progress = Math.ceil((FILEObject.uploadedFiles / FILEObject.queuedFiles) * 100);

FILEObject.printStatus(this.customSettings.loadedTotal, FILEObject.uploadedFiles);
FILEObject.printStatus(this.customSettings.statusTarget, "");
document.getElementById(this.customSettings.progressBar).style.width = progress + "%";
} catch (ex) {
this.debug(ex);
}
Expand All @@ -204,7 +196,14 @@ function uploadSuccess(file, serverData) {
*/
function uploadComplete(file) {
try {
var stats = this.getStats();
var stats = this.getStats(), progress;

FILEObject.uploadedFiles += 1;

progress = Math.ceil((FILEObject.uploadedFiles / FILEObject.queuedFiles) * 100);

FILEObject.printStatus(this.customSettings.loadedTotal, FILEObject.uploadedFiles);
document.getElementById(this.customSettings.progressBar).style.width = progress + "%";

if (stats.files_queued === 0) {
document.getElementById(this.customSettings.cancelButtonId).disabled = true;
Expand Down

0 comments on commit 18f7f80

Please sign in to comment.