Author: dbiatenia
Date: 2007-07-25 09:17:15 -0400 (Wed, 25 Jul 2007)
New Revision: 1842
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
---
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25
13:11:53 UTC (rev 1841)
+++
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25
13:17:15 UTC (rev 1842)
@@ -169,7 +169,10 @@
var x = Event.pointerX(e);
var y = Event.pointerY(e);
-
+
+ var toolTipDim = Element.getDimensions(this.toolTip);
+ this.toolTipW = toolTipDim.width;
+ this.toolTipH = toolTipDim.height;
var offsets = Position.cumulativeOffset(this.toolTip);
offsets[0] -= this.toolTip.offsetLeft || 0;
@@ -177,6 +180,9 @@
toolTipX = x - offsets[0];
toolTipY = y - offsets[1];
+
+ Element.setStyle(this.toolTip, {"left": toolTipX + "px",
"top": toolTipY + "px"});
+ //alert(this.toolTipW + 'x' + this.toolTipY);
/*
var p = Element.getStyle(this.toolTip.parentNode, 'position');
@@ -229,8 +235,8 @@
if(this.direction == "top-left"){
- this.toolTip.style.top = toolTipY - this.verticalOffset - this.toolTipH;
- this.toolTip.style.left = toolTipX - this.horizontalOffset - this.toolTipW;
+ toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
+ toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
/*
if(cursorY - this.verticalOffset - this.toolTipH < 0){
this.toolTip.style.top = cursorY + this.verticalOffset - this.toolTipH;
@@ -244,8 +250,8 @@
}
*/
} else if(this.direction == "bottom-left"){
- this.toolTip.style.top = toolTipY + this.verticalOffset;
- this.toolTip.style.left = toolTipX - this.horizontalOffset - this.toolTipW;
+ toolTipY = toolTipY + this.verticalOffset;
+ toolTipX = toolTipX - this.horizontalOffset - this.toolTipW;
/*
if(cursorY + this.verticalOffset + this.toolTipH > windowDim[1]){
this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
@@ -259,8 +265,8 @@
}
*/
} else if(this.direction == "top-right"){
- this.toolTip.style.top = toolTipY - this.verticalOffset - this.toolTipH;
- this.toolTip.style.left = toolTipX + this.horizontalOffset;
+ toolTipY = toolTipY - this.verticalOffset - this.toolTipH;
+ toolTipX = toolTipX + this.horizontalOffset;
/*
if(cursorY - this.verticalOffset - this.toolTipH < 0){
this.toolTip.style.top = cursorY + this.verticalOffset;
@@ -275,8 +281,8 @@
*/
} else {
// bottom-right is default
- this.toolTip.style.top = toolTipY + this.verticalOffset;
- this.toolTip.style.left = toolTipX + this.horizontalOffset;
+ toolTipY = toolTipY + this.verticalOffset;
+ toolTipX = toolTipX + this.horizontalOffset;
/*
if(cursorY + this.verticalOffset - this.toolTip.clientHeight > windowDim[1]){
this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
@@ -290,7 +296,9 @@
}
*/
}
+ Element.setStyle(this.toolTip, {"left": toolTipX + "px",
"top": toolTipY + "px"});
+
},
windowSize: function() {
Show replies by date