diff options
author | Christophe.Boulain <> | 2009-07-22 06:22:38 +0000 |
---|---|---|
committer | Christophe.Boulain <> | 2009-07-22 06:22:38 +0000 |
commit | 4471057588998c9442a2bf683fc9c3d65d1e900b (patch) | |
tree | 5a85e193f64250848e1fe7b409105117ee90845c /framework/Web/Javascripts | |
parent | 5aaf2cecb4e365c5503c3167535303d3300a6b6d (diff) |
Fixed #178
Diffstat (limited to 'framework/Web/Javascripts')
-rwxr-xr-x | framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js index 7a1e0e77..222b9fe3 100755 --- a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js +++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js @@ -36,20 +36,41 @@ Prado.WebUI.TActiveFileUpload = Base.extend( }, finishUpload : function(options){ + + if (this.options.targetID == options.targetID) + { + this.finishoptions = options; + var e = this; + var callback = + { + 'CallbackParameter' : options || '', + 'onSuccess' : function() { e.finishCallBack(true); }, + 'onFailure' : function() { e.finishCallBack(false); } + }; + + Object.extend(callback, this.options); + + request = new Prado.CallbackRequest(this.options.EventTarget, callback); + request.dispatch(); + } + else + this.finishCallBack(true); + + }, + + finishCallBack : function(success){ // hide the display indicator. this.flag.value = ''; this.indicator.style.display = 'none'; - if (this.options.targetID == options.targetID){ - // show the complete indicator. - if (options.errorCode == 0){ - this.complete.style.display = ''; - this.input.value = ''; - } else { - this.error.style.display = ''; - } - Prado.Callback(this.options.EventTarget, options, null, this.options); - } + // show the complete indicator. + if ((this.finishoptions.errorCode == 0) && (success)) { + this.complete.style.display = ''; + this.input.value = ''; + } else { + this.error.style.display = ''; + } } + }, { // class methods |