Author: pyaschenko
Date: 2007-10-01 10:50:35 -0400 (Mon, 01 Oct 2007)
New Revision: 3178
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
RF-998
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-10-01
14:35:51 UTC (rev 3177)
+++
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-10-01
14:50:35 UTC (rev 3178)
@@ -139,10 +139,30 @@
// Return true if "element" is "leaf" or one of its parents
var node = leaf;
while (node != null && node != element)
- node = node.parentNode;
+ {
+ node = node.parentNode;
+ }
return (node != null);
},
+ ffcheck: function(relTarg)
+ {
+ // FF fix [Exception... "'Permission denied to get property
HTMLDivElement.parentNode' when calling method...]
+ if (this.parent.tagName.toLowerCase()=="input" && relTarg)
+ {
+ var className;
+ try {
+ className = relTarg.className;
+ if (className=="anonymous-div") return true;
+ } catch (e)
+ {
+ return true;
+ }
+ if (relTarg==this.parent) return true;
+ }
+ return false;
+ //end fix
+ },
leaveToolTip: function(e) {
@@ -150,8 +170,16 @@
// detect mouse move from hint to owner
// if mouse entered the just the owner hintNotLeft is set true
- hintNotLeft = this.detectAncestorNode(e.toElement,this.hintParentElement);
- hintNotLeft = hintNotLeft ||
this.detectAncestorNode(e.relatedTarget,this.hintParentElement);
+ var relTarg = e.relatedTarget || e.toElement;
+ var className;
+ if (relTarg)
+ {
+ try {
+ className = relTarg.className;
+ if (className!="anonymous-div");
+ hintNotLeft = this.detectAncestorNode(relTarg,this.hintParentElement);
+ } catch (e) {;}
+ }
if (!hintNotLeft){
this.doHide(e);
@@ -161,22 +189,23 @@
doShow: function(e){
- var needToShow = true;
var obj;
if (!e) var e = window.event;
+
var relTarg = e.relatedTarget || e.fromElement;
-
- while(relTarg){
- if(relTarg == this.parent){
- needToShow = false;
- break;
- }
- relTarg = relTarg.parentNode;
+
+ if (this.ffcheck(relTarg)) return;
+
+ var className;
+ if (relTarg)
+ {
+ try {
+ className = relTarg.className;
+ if (className!="anonymous-div");
+ if (this.detectAncestorNode(relTarg,this.toolTip)) return;
+ } catch (e) {;}
}
- if(!needToShow) return;
-
-
this.onshow(e);
this.isMouseOvered = true;
@@ -228,44 +257,37 @@
doHide: function(e){
this.eventCopy = null;
- var needToHide = true;
-
if (!e) var e = window.event;
+
var relTarg = e.relatedTarget || e.toElement;
- while(relTarg){
- if(relTarg == this.parent){
- needToHide = false;
- break;
- }
- relTarg = relTarg.parentNode;
- }
-
+ if (this.ffcheck(relTarg)) return;
- if(!needToHide) return;
-
if (this.activationTimerHandle) {
clearTimeout(this.activationTimerHandle);
this.activationTimerHandle = undefined;
}
- var fakeEvent = false;
- fakeEvent = this.detectAncestorNode(e.toElement,this.toolTip);
- fakeEvent = fakeEvent || this.detectAncestorNode(e.relatedTarget,this.toolTip);
-
+ var className;
+ if (relTarg)
+ {
+ try {
+ className = relTarg.className;
+ if (className!="anonymous-div");
+ if (this.detectAncestorNode(relTarg,this.toolTip)) return;
+ } catch (e) {;}
+ }
- if (!fakeEvent) {
- this.isMouseOvered = false;
- this.toolTip.style.visibility = "hidden";
- this.toolTip.style.display = "none";
-
- if(this.iframe){
- this.iframe.style.display = "none";
- }
- this.hintParentElement = null;
- this.isMouseOvered = false;
- this.onhide(e);
+ this.isMouseOvered = false;
+ this.toolTip.style.visibility = "hidden";
+ this.toolTip.style.display = "none";
+
+ if(this.iframe){
+ this.iframe.style.display = "none";
}
+ this.hintParentElement = null;
+ this.isMouseOvered = false;
+ this.onhide(e);
},
doEnable: function(){