Author: andrei_exadel
Date: 2008-03-25 10:51:25 -0400 (Tue, 25 Mar 2008)
New Revision: 7172
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-2740
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
14:24:56 UTC (rev 7171)
+++
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-03-25
14:51:25 UTC (rev 7172)
@@ -746,8 +746,18 @@
},
_updateClassNames: function (d1,d2,buttonClass,buttonContentClass) {
- d1.className = (this.disabled ? buttonClass.DISABLED : buttonClass.ENABLED);
- d2.className = (this.disabled ? buttonContentClass.DISABLED :
buttonContentClass.ENABLED);
+ if (this.disabled) {
+ d1.className = buttonClass.DISABLED;
+ d2.className = buttonContentClass.DISABLED;
+ d1.onmouseover = d1.onmouseout = d1.onmousedown = d1.onmouseup = null;
+ }else {
+ d1.className = buttonClass.ENABLED;
+ d2.className = buttonContentClass.ENABLED;
+ d1.onmouseover = function () {this.className='upload_button_light
upload_font';};
+ d1.onmouseout = function () {this.className='upload_button upload_font';};
+ d1.onmousedown = function () {this.className='upload_button_press
upload_font';};
+ d1.onmouseup = function () {this.className='upload_button upload_font';};
+ }
},
disable: function () {
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-25
14:24:56 UTC (rev 7171)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-03-25
14:51:25 UTC (rev 7172)
@@ -48,11 +48,6 @@
variables.setVariable("listHeight", getFileListHeight(component));
Integer max = initMaxFilesCount(context, component, clientId);
- String addStyle = "";
- if (max == 0) {
- addStyle = "; display: none;";
- }
- variables.setVariable("addStyle", addStyle);
variables.setVariable("maxCount", max);
]]>
</jsp:scriptlet>
@@ -73,7 +68,7 @@
<table class="upload_toolbar_decor">
<tr>
<td>
- <div class="upload_button_border" style=" float:left;
#{addStyle}">
+ <div class="upload_button_border" style=" float:left;">
<div class="#{addButtonClass}"
onmouseover="this.className='upload_button_light upload_font'"
onmousedown="this.className='upload_button_press upload_font'"
onmouseup="this.className='upload_button upload_font'"
onmouseout="this.className='upload_button upload_font'"
style="position: relative;"
id="#{clientId}:add1">