Author: Alex.Kolonitsky
Date: 2009-11-22 09:06:47 -0500 (Sun, 22 Nov 2009)
New Revision: 15958
Modified:
branches/sandbox/3.3.X_JSF2/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
3.3.2GA combobox: in right-to-left languages (when dir=rtl) the selectedItem is partially
hidden by the button
https://jira.jboss.org/jira/browse/RF-8028
Modified:
branches/sandbox/3.3.X_JSF2/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
---
branches/sandbox/3.3.X_JSF2/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-11-22
02:29:37 UTC (rev 15957)
+++
branches/sandbox/3.3.X_JSF2/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-11-22
14:06:47 UTC (rev 15958)
@@ -17,7 +17,9 @@
this.tempItem;
this.BUTTON_WIDTH = 17; //px
-
+ this.BUTTON_LEFT_BORDER = 1; //px
+ this.BUTTON_RIGHT_BORDER = 1; //px
+
this.classes = Richfaces.mergeStyles(options.userStyles,new
Richfaces.ComboBoxStyles().getCommonStyles());
@@ -115,8 +117,18 @@
},
setInputWidth : function() {
- var width = parseInt(this.field.parentNode.style.width) - this.BUTTON_WIDTH;
- this.field.style.width = width + "px";
+ var width;
+ if (Richfaces.browser.isIE6) {
+ width = parseInt(this.field.parentNode.style.width) - this.BUTTON_WIDTH;
+ } else {
+ width = parseInt(this.field.parentNode.style.width)
+ - parseInt(Element.getStyle(this.field, Richfaces.borders.l))
+ - parseInt(Element.getStyle(this.field, Richfaces.paddings.l))
+ - parseInt(Element.getStyle(this.field, Richfaces.paddings.r))
+ - parseInt(Element.getStyle(this.field, Richfaces.borders.r));
+ width -= this.buttonBG.offsetWidth ? this.buttonBG.offsetWidth :
this.BUTTON_WIDTH;
+ }
+ this.field.style.width = width + "px";
},
buttonClickHandler : function(event) {