Author: vmolotkov
Date: 2008-03-31 08:44:01 -0400 (Mon, 31 Mar 2008)
New Revision: 7458
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
Log:
http://jira.jboss.com/jira/browse/RF-2868
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
===================================================================
---
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-03-31
12:31:49 UTC (rev 7457)
+++
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-03-31
12:44:01 UTC (rev 7458)
@@ -23,14 +23,20 @@
Richfaces.getDocumentHeight = function() {
- var body = Richfaces.getBody();
- var innerHeight =
(Richfaces.defined(self.innerHeight)&&!isNaN(self.innerHeight))?self.innerHeight:0;
- if (document.documentElement && (!document.compatMode ||
document.compatMode=="CSS1Compat")) {
- var topMargin = Richfaces.getMarginWidth(body, 't');
- var bottomMargin = Richfaces.getMarginWidth(body, 'b');
- return Math.max(body.offsetHeight + topMargin + bottomMargin,
document.documentElement.clientHeight, document.documentElement.scrollHeight,
Richfaces.zero(self.innerHeight));
- }
- return Math.max(body.scrollHeight, body.clientHeight,
Richfaces.zero(self.innerHeight));
+ var viewportheight = null;
+ if (typeof window.innerWidth != 'undefined') {
+ // the more standards compliant browsers (mozilla/netscape/opera/IE7) use
window.innerWidth and window.innerHeight
+ viewportheight = window.innerHeight;
+ } else if (typeof document.documentElement != 'undefined'
+ && typeof document.documentElement.clientWidth != 'undefined'
+ && document.documentElement.clientWidth != 0) {
+ // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the
document)
+ viewportheight = document.documentElement.clientHeight;
+ } else {
+ // older versions of IE
+ viewportheight = document.getElementsByTagName('body')[0].clientHeight;
+ }
+ return viewportheight;
}
Richfaces.getScrollWidth = function(elem) {
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-31
12:31:49 UTC (rev 7457)
+++
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-03-31
12:44:01 UTC (rev 7458)
@@ -201,7 +201,7 @@
var docHeight = Richfaces.getDocumentHeight();
- var comBottom = fieldTop + fieldHeight;
+ var comBottom = fieldTop + fieldHeight - document.documentElement.scrollTop;
var listHeight = parseInt(this.list.style.height) +
Richfaces.getBorderWidth(this.list.parentNode, "tb");
//var top = 0 ;//= -4;