Author: andrei_exadel
Date: 2008-03-12 08:34:04 -0400 (Wed, 12 Mar 2008)
New Revision: 6745
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
Log:
RF-2458
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-03-12
11:34:25 UTC (rev 6744)
+++
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-12
12:34:04 UTC (rev 6745)
@@ -54,12 +54,12 @@
[
new E('td',{'className':function (context) { return
'upload_font upload_name upload_table_td ' +
Richfaces.evalMacro("className", context);}},
[
- new
E('div',{'className':'upload_name_padding','style':'overflow-x
: hidden;'},
+ new
E('div',{'className':'upload_name_padding','style':function
(context) {return 'overflow-x : hidden; width:' +
Richfaces.evalMacro("fileEntryWidth", context);}},
[
new ET(function (context) { return
Richfaces.evalMacro("fileName", context)})
]),
new E('div',{ }),
- new E('div',{'className':'upload_name_padding'},
+ new
E('div',{'className':'upload_name_padding','style':function
(context) {return 'overflow-x : hidden; width:' +
Richfaces.evalMacro("fileEntryWidth", context);}},
[
new ET(function (context) { return Richfaces.evalMacro("label",
context)})
])
@@ -124,7 +124,7 @@
this.fileInput = fileInput;
this.uploadObject = uploadObject;
- var content = FileUploadEntry.template.invoke('getContent', {fileName:
$F(this.fileInput), className : this.uploadObject.classes.FILE_ENTRY.ENABLED
}).join('');
+ var content = FileUploadEntry.template.invoke('getContent', {fileName:
$F(this.fileInput), fileEntryWidth: uploadObject.fileEntryWidth, className :
this.uploadObject.classes.FILE_ENTRY.ENABLED }).join('');
Element.insert(this.uploadObject.items, content);
@@ -401,8 +401,24 @@
this.initEvents();
this.setupAutoUpload();
this.checkFrame();
+ this.initFileEntryWidth();
},
+ initFileEntryWidth: function () {
+ var w = this.element.clientWidth - 115;
+ this.fileEntryWidth = w;
+ var progressW = this._progressBar.style.width;
+ if (progressW == "") { progressW = 200; }
+ if (progressW > this.fileEntryWidth) {
+ this._progressBar.style.width = w;
+ var r = $(this._progressBar.id + ":remain");
+ if (r) {
+ r.style.width = w;
+ $(this._progressBar.id + ":complete").style.width = w;
+ }
+ }
+ },
+
createFrame: function () {
var div = document.createElement("div");
div.style.display = 'none';
Show replies by date