Author: vmolotkov
Date: 2008-03-12 11:19:05 -0400 (Wed, 12 Mar 2008)
New Revision: 6759
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
Log:
bug
http://jira.jboss.com/jira/browse/RF-2453
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
===================================================================
---
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-03-12
15:12:26 UTC (rev 6758)
+++
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-03-12
15:19:05 UTC (rev 6759)
@@ -116,6 +116,11 @@
if (this.iframe) {
this.iframe.hide();
}
+
+ var component = this.listParent.parentNode;
+ component.style.position = "static";
+ component.style.zIndex = 0;
+
this.listParent.hide();
},
@@ -219,21 +224,26 @@
},
setPosition : function(fieldTop, fieldLeft, fieldHeight) {
+ var component = this.listParent.parentNode;
+ component.style.position = "relative";
+ component.style.zIndex = 2;
+
+
var docHeight = Richfaces.getDocumentHeight();
var comBottom = fieldTop + fieldHeight;
var listHeight = parseInt(this.list.style.height) +
Richfaces.getBorderWidth(this.list.parentNode, "tb");
//var top = 0 ;//= -4;
- var top = comBottom;
+ var top = fieldHeight;
if (parseInt(listHeight) > (docHeight - comBottom)) {
if (fieldTop > (docHeight - comBottom)) {
- top = fieldTop - parseInt(listHeight);
+ top = 0 - parseInt(listHeight);
//var upPos = true;
}
}
-
+
this.listParent.style.top = top + "px";
- this.listParent.style.left = fieldLeft + "px";
+ this.listParent.style.left = 0 + "px";
/*if (!upPos) {
top = Richfaces.ComboBoxList.getElemXY(this.listParent).top +
this.fieldDimensions.height;
@@ -415,7 +425,8 @@
var y = elem.offsetTop;
- for (var parent = Element.getOffsetParent(elem); parent != document.body; parent =
Element.getOffsetParent(parent)) {
+ //for (var parent = Element.getOffsetParent(elem); parent != document.body; parent =
Element.getOffsetParent(parent)) {
+ for (var parent = elem.offsetParent; parent; parent = parent.offsetParent) {
x += parent.offsetLeft;
y += parent.offsetTop;
}