Author: dbiatenia
Date: 2007-07-25 05:48:50 -0400 (Wed, 25 Jul 2007)
New Revision: 1836
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
08:54:56 UTC (rev 1835)
+++
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25
09:48:50 UTC (rev 1836)
@@ -125,8 +125,12 @@
var event = e;
eval(this.ajaxExecuteString);
}
+ if(this.delay > 0){
+ setTimeout(this.jsVarName + '.displayDiv()', this.delay);
+ } else {
+ this.displayDiv();
+ }
- setTimeout(this.jsVarName + '.displayDiv()', this.delay);
},
doHide: function(e){
@@ -158,31 +162,22 @@
setToolTipPosition: function(e){
- var windowDim = this.windowSize();
- var cursorX = e.clientX + document.body.scrollLeft;
- var cursorY = e.clientY + document.body.scrollTop;
-
- if(this.toolTip.style.display != 'none'){
- this.toolTipH = this.toolTip.getHeight();
- this.toolTipW = this.toolTip.getWidth();
- }
-/*
- this.toolTip.style.display = 'block';
-
- this.toolTip.style.top = cursorY;
- this.toolTip.style.left = cursorX;
-*/
- //var offsets = Position.cumulativeOffset(this.toolTip.parentNode);
- var offsets = Position.cumulativeOffset(this.toolTip.parentNode);
+// var offsets = Position.cumulativeOffset(this.toolTip.parentNode);
-
-
-// offsets[0] -= this.toolTip.parentNode.offsetLeft || 0;
-// offsets[1] -= this.toolTip.parentNode.offsetTop || 0;
-//
-//
var toolTipX=0;
var toolTipY=0;
+
+ var x = Event.pointerX(e);
+ var y = Event.pointerY(e);
+
+
+ var offsets = Position.cumulativeOffset(this.toolTip);
+ offsets[0] -= this.toolTip.offsetLeft || 0;
+ offsets[1] -= this.toolTip.offsetTop || 0;
+
+ toolTipX = x - offsets[0];
+ toolTipY = y - offsets[1];
+/*
var p = Element.getStyle(this.toolTip.parentNode, 'position');
if (p == 'relative'){
@@ -208,6 +203,7 @@
// this.toolTip.style.left = cursorX;
}
}
+*/
//Element.setStyle(this.toolTip, {"left": toolTipX + "px",
"top": toolTipY + "px"});
//
Show replies by date