Author: nbelaevski
Date: 2007-03-14 15:13:42 -0400 (Wed, 14 Mar 2007)
New Revision: 71
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
Richfaces.isNodeInDOMTree function added
Modified:
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
---
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-03-14
14:45:27 UTC (rev 70)
+++
trunk/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-03-14
19:13:42 UTC (rev 71)
@@ -48,3 +48,13 @@
if ( pxIndex == -1 ) return str;
return str.substr(0,pxIndex);
};
+
+Richfaces.isNodeInDOMTree = function(node) {
+ var root = document.documentElement;
+ var elt = node;
+ while (elt && elt != root) {
+ elt = elt.parentNode;
+ }
+
+ return !!elt;
+};
\ No newline at end of file
Show replies by date