Author: andrei_exadel
Date: 2008-03-25 11:45:52 -0400 (Tue, 25 Mar 2008)
New Revision: 7174
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
RF-2741
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-25
15:29:19 UTC (rev 7173)
+++
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-25
15:45:52 UTC (rev 7174)
@@ -415,6 +415,7 @@
this.initFileEntryWidth();
this.initLabels(labels);
this.initFileInput();
+ this.processButtons();
},
initLabels: function (labels) {
@@ -559,9 +560,10 @@
var newUpload = elt.cloneNode(true);
elt.onchange = null;
+ elt.style.cssText = "position: absolute; right: 0px; top: 0px; display: none;
visibility: hidden;";
newUpload.id = this.id + ":file" + (this.idCounter++);
this.currentInput = newUpload;
- $(this.id + ":add1").appendChild(newUpload);
+ elt.parentNode.appendChild(newUpload);
if (this.runUpload) {
this.upload();
@@ -716,7 +718,7 @@
},
disableAddButton: function() {
- var disabled = ((this.getFileEntriesSumByState(FileUploadEntry.READY,
FileUploadEntry.INITIALIZED, FileUploadEntry.UPLOAD_CANCELED) + this.uploadedCount) >=
this.maxFileBatchSize);
+ var disabled = ((this.getFileEntriesSumByState(FileUploadEntry.READY,
FileUploadEntry.INITIALIZED, FileUploadEntry.UPLOAD_CANCELED) + this.uploadedCount +
this.getFileEntriesSumByState(FileUploadEntry.UPLOAD_IN_PROGRESS)) >=
this.maxFileBatchSize);
this.currentInput.disabled = disabled || this.disabled;
var _disabled = this.disabled;
var d1 = $(this.id+":add1");
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-25
15:29:19 UTC (rev 7173)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-25
15:45:52 UTC (rev 7174)
@@ -25,11 +25,15 @@
<jsp:scriptlet>
<![CDATA[
+ Integer max = initMaxFilesCount(context, component, clientId);
+ variables.setVariable("maxCount", max);
+
boolean disabled = (Boolean)component.getAttributes().get("disabled");
String addButtonClass = (disabled) ? "upload_button_dis upload_font " +
(String)component.getAttributes().get("addButtonClassDisabled")
: "upload_button upload_font " +
(String)component.getAttributes().get("addButtonClass");
String addButtonClassContent = (disabled) ? "upload_button_content upload_font
upload_ico upload_ico_add_dis " +
(String)component.getAttributes().get("addButtonClassDisabled")
: "upload_button_content upload_font upload_ico upload_ico_add " +
(String)component.getAttributes().get("addButtonClass");
+
String uploadListClass = (disabled) ?
(String)component.getAttributes().get("uploadListClassDisabled") :
(String)component.getAttributes().get("uploadListClass");
variables.setVariable("addButtonClass",addButtonClass);
variables.setVariable("addButtonClassContent",addButtonClassContent);
@@ -46,9 +50,7 @@
variables.setVariable("listWidth", getFileListWidth(component));
variables.setVariable("listHeight", getFileListHeight(component));
-
- Integer max = initMaxFilesCount(context, component, clientId);
- variables.setVariable("maxCount", max);
+
]]>
</jsp:scriptlet>
@@ -80,7 +82,6 @@
class="hidden"
id="#{clientId}:file"
name="#{clientId}:file"
- disabled="#{component.attributes['disabled']}"
onchange="return
$('#{clientId}').component.add(this);"/>
</div>
</div>
Show replies by date