Author: andrei_exadel
Date: 2008-05-15 08:49:53 -0400 (Thu, 15 May 2008)
New Revision: 8590
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
RF-3416
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
---
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-05-15
12:09:01 UTC (rev 8589)
+++
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-05-15
12:49:53 UTC (rev 8590)
@@ -307,7 +307,7 @@
var error = null;
try {
- if (!Prototype.Browser.Opera && this.iframe.contentWindow &&
this.iframe.contentWindow.document) {
+ if (!Prototype.Browser.Opera && !Prototype.Browser.WebKit &&
this.iframe.contentWindow && this.iframe.contentWindow.document) {
loaded = /complete/.test(this.iframe.contentWindow.document.readyState);
}
} catch (e) {
@@ -317,7 +317,7 @@
if (error) {
this.stop();
this.onerror();
- }
+ }
}
return false;
}.bind(this),200);
@@ -490,6 +490,7 @@
$(this._progressBar.id + ":complete").style.width = w;
}
}
+ this.fileEntryWidth = this.fileEntryWidth + "px";
return this.fileEntryWidth;
},
@@ -552,9 +553,21 @@
prepareProgressBar: function () {
this.progressBar.setValue(0);
Element.show(this._progressBar);
+ this.progressBar.options.onerror = function (e) {
+ this.errorHandler(e);
+ }.bind(this);
this.progressBar.enable();
},
+ errorHandler: function (e) {
+ if (this.watcher) {
+ this.watcher.stop();
+ this.watcher.onerror();
+ this.watcher = null;
+ //alert('error: ' + e);
+ }
+ },
+
finishProgressBar: function () {
this.progressBar.disable();
this.progressBar.setValue(100);
@@ -994,7 +1007,7 @@
if (!parentForm.onsubmit || parentForm.onsubmit()) {
var iframe = this.createFrame();
- new LoadWatcher(iframe, function(newState) {
+ this.watcher = new LoadWatcher(iframe, function(newState) {
this.finishProgressBar();
this.setState(newState);
}.bind(entry),
Show replies by date