Author: vmolotkov
Date: 2008-03-14 09:30:15 -0400 (Fri, 14 Mar 2008)
New Revision: 6811
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
[RF-2213]combobox: the cursor blocks on the button
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
---
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-03-14
13:22:59 UTC (rev 6810)
+++
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2008-03-14
13:30:15 UTC (rev 6811)
@@ -15,11 +15,15 @@
this.combobox = $(combobox);
this.comboValue = $(valueFieldId);
this.field = $(fieldId);
+ this.BUTTON_WIDTH = 17; //px
//this.field.prevValue = null;
this.button = $(buttonId);
this.buttonBG = $(buttonBGId);
+
+ this.setInputWidth();
+
// var fieldDem = Richfaces.ComboBoxList.getElemXY(this.field);
// fieldDem.height = this.field.offsetHeight;
listWidth = (!listWidth) ? this.getCurrentWidth() : listWidth;
@@ -72,6 +76,18 @@
this.comboList.listParent.observe("click",
function(e){this.listClickHandler(e);}.bindAsEventListener(this));
},
+ setInputWidth : function() {
+ var width = (parseInt(this.field.parentNode.style.width) - this.BUTTON_WIDTH) +
Richfaces.getBorderWidth(this.field, "r");
+ if (Prototype.Browser.Gecko) {
+ //border width and padding width not included in the general component width
+ width -= Richfaces.getPaddingWidth(this.field, "lr")
+ + Richfaces.getPaddingWidth(this.button, "lr")
+ + Richfaces.getBorderWidth(this.field, "lr")
+ + Richfaces.getBorderWidth(this.button, "lr");
+ }
+ this.field.style.width = width + "px";
+ },
+
buttonClickHandler : function(event) {
if (this.comboList.visible()) {
this.comboList.hideWithDelay();
Show replies by date