diff options
Diffstat (limited to 'framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js')
-rwxr-xr-x | framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js index 9f57f912..7a1e0e77 100755 --- a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js +++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js @@ -13,11 +13,15 @@ Prado.WebUI.TActiveFileUpload = Base.extend( this.complete = $(options.completeID); this.error = $(options.errorID); + Prado.Registry.set(options.inputID, this); + // set up events - Event.observe(this.input,"change",this.fileChanged.bind(this)); + if (options.autoPostBack){ + Event.observe(this.input,"change",this.fileChanged.bind(this)); + } }, - fileChanged:function(){ + fileChanged : function(){ // show the upload indicator, and hide the complete and error indicators (if they areSn't already). this.flag.value = '1'; this.complete.style.display = 'none'; @@ -31,7 +35,7 @@ Prado.WebUI.TActiveFileUpload = Base.extend( this.form.target = this.oldtargetID; }, - finishUpload:function(options){ + finishUpload : function(options){ // hide the display indicator. this.flag.value = ''; this.indicator.style.display = 'none'; @@ -56,8 +60,12 @@ Prado.WebUI.TActiveFileUpload = Base.extend( Prado.WebUI.TActiveFileUpload.controls[control.options.ID] = control; }, - onFileUpload: function(options) + onFileUpload : function(options) { Prado.WebUI.TActiveFileUpload.controls[options.clientID].finishUpload(options); + }, + + fileChanged : function(controlID){ + Prado.WebUI.TActiveFileUpload.controls[controlID].fileChanged(); } -});
\ No newline at end of file +}); |