summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/source
diff options
context:
space:
mode:
authorChristophe.Boulain <>2009-04-14 11:27:19 +0000
committerChristophe.Boulain <>2009-04-14 11:27:19 +0000
commit37cd9aec35acd0cd03946fc6f26d7fe02c3c5d48 (patch)
treeac7ebf698fedfc5b0553b097ed8bf2d74dce1a0e /framework/Web/Javascripts/source
parentca080e5dc8ff461f63f2e22e83a3b3898642c5ba (diff)
Fixed Issue#135 - Add AutoPostBack property to TActiveFileUpload
Diffstat (limited to 'framework/Web/Javascripts/source')
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/activefileupload.js136
1 files changed, 71 insertions, 65 deletions
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
index faaab19a..7a1e0e77 100755
--- a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
+++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
@@ -1,65 +1,71 @@
-Prado.WebUI.TActiveFileUpload = Base.extend(
-{
- constructor : function(options)
- {
- this.options = options || {};
- Prado.WebUI.TActiveFileUpload.register(this);
-
- this.input = $(options.inputID);
- this.flag = $(options.flagID);
- this.form = $(options.formID);
-
- this.indicator = $(options.indicatorID);
- 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));
- },
-
- 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';
- this.error.style.display = 'none';
- this.indicator.style.display = '';
-
- // set the form to submit in the iframe, submit it, and then reset it.
- this.oldtargetID = this.form.target;
- this.form.target = this.options.targetID;
- this.form.submit();
- this.form.target = this.oldtargetID;
- },
-
- finishUpload:function(options){
- // 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);
- }
- }
-},
-{
-// class methods
- controls : {},
-
- register : function(control)
- {
- Prado.WebUI.TActiveFileUpload.controls[control.options.ID] = control;
- },
-
- onFileUpload: function(options)
- {
- Prado.WebUI.TActiveFileUpload.controls[options.clientID].finishUpload(options);
- }
-});
+Prado.WebUI.TActiveFileUpload = Base.extend(
+{
+ constructor : function(options)
+ {
+ this.options = options || {};
+ Prado.WebUI.TActiveFileUpload.register(this);
+
+ this.input = $(options.inputID);
+ this.flag = $(options.flagID);
+ this.form = $(options.formID);
+
+ this.indicator = $(options.indicatorID);
+ this.complete = $(options.completeID);
+ this.error = $(options.errorID);
+
+ Prado.Registry.set(options.inputID, this);
+
+ // set up events
+ if (options.autoPostBack){
+ Event.observe(this.input,"change",this.fileChanged.bind(this));
+ }
+ },
+
+ 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';
+ this.error.style.display = 'none';
+ this.indicator.style.display = '';
+
+ // set the form to submit in the iframe, submit it, and then reset it.
+ this.oldtargetID = this.form.target;
+ this.form.target = this.options.targetID;
+ this.form.submit();
+ this.form.target = this.oldtargetID;
+ },
+
+ finishUpload : function(options){
+ // 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);
+ }
+ }
+},
+{
+// class methods
+ controls : {},
+
+ register : function(control)
+ {
+ Prado.WebUI.TActiveFileUpload.controls[control.options.ID] = control;
+ },
+
+ onFileUpload : function(options)
+ {
+ Prado.WebUI.TActiveFileUpload.controls[options.clientID].finishUpload(options);
+ },
+
+ fileChanged : function(controlID){
+ Prado.WebUI.TActiveFileUpload.controls[controlID].fileChanged();
+ }
+});