Author: pyaschenko
Date: 2007-09-12 11:21:57 -0400 (Wed, 12 Sep 2007)
New Revision: 2906
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
RF-890
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-09-12
15:06:37 UTC (rev 2905)
+++
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-09-12
15:21:57 UTC (rev 2906)
@@ -59,8 +59,10 @@
this.iframe = $(this.id + 'iframe');
}
- if(!this.disabled) Event.observe(document, "mousemove",
this.attachOnLoadEvents.bindAsEventListener(this), true);
- //it means we have only one tooltip for elements
+ this.attachOnLoadEventsListner = this.attachOnLoadEvents.bindAsEventListener(this);
+
+ if(!this.disabled) Event.observe(document, "mousemove",
this.attachOnLoadEventsListner, true);
+ //it means we have only one tooltip for element
Richfaces.tooltips[parentId] = this;
},
attachOnLoadEvents: function(){
@@ -70,7 +72,7 @@
this.attachParentEvents();
this.parentAttached = true;
}
- Event.stopObserving(document, "mousemove",
this.attachOnLoadEvents.bindAsEventListener(this), false);
+ Event.stopObserving(document, "mousemove", this.attachOnLoadEventsListner,
true);
}
},
attachParentEvents: function(){
@@ -276,6 +278,12 @@
var coords = this.fitToolTip(e.clientX, e.clientY, {'x':toolTipX ,
'y':toolTipY},elementDim, horizontalDirection, verticalDirection,
{'x':this.horizontalOffset, 'y':this.verticalOffset});
Element.setStyle(this.toolTip, {"left": coords.x + "px",
"top": coords.y + "px"});
+ if(this.iframe)
+ {
+ this.iframe.style.top = (coords.y - this.toolTipBorderHeight) + 'px';
+ this.iframe.style.left = (coords.x - this.toolTipBorderWidth) + 'px';
+ }
+
this.eventCopy = null;
if (this.delay>0)
{
@@ -404,11 +412,11 @@
this.activationTimerHandle = undefined;
this.toolTip.style.display = "block";
this.toolTip.style.visibility = "visible";
- if(this.iframe){
- this.iframe.style.top = parseInt(this.toolTip.style.top) - this.toolTipBorderHeight;
- this.iframe.style.left = parseInt(this.toolTip.style.left) - this.toolTipBorderWidth;
- this.iframe.style.display = "block";
- }
+ if(this.iframe)
+ {
+ this.iframe.style.display = "block";
+ }
+
if(runOnComplete){
this.oncomplete(window.event);
}