Author: nbelaevski
Date: 2008-06-03 10:33:00 -0400 (Tue, 03 Jun 2008)
New Revision: 8889
Modified:
branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
Log:
http://jira.jboss.com/jira/browse/RF-1948
http://jira.jboss.com/jira/browse/RF-3621
Modified:
branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
---
branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-06-03
14:17:11 UTC (rev 8888)
+++
branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-06-03
14:33:00 UTC (rev 8889)
@@ -348,3 +348,48 @@
var windowOffset = Richfaces.Position.getWindowScrollOffset();
return {left:windowOffset.left, top:windowOffset.top, right:
windowDim.width+windowOffset.left, bottom: windowDim.height+windowOffset.top};
};
+
+Richfaces.firstDescendant = function(node) {
+ var n = node.firstChild;
+ while (n && n.nodeType != 1) {
+ n = n.nextSibling;
+ }
+
+ return n;
+};
+
+Richfaces.lastDescendant = function(node) {
+ var n = node.lastChild;
+ while (n && n.nodeType != 1) {
+ n = n.previousSibling;
+ }
+
+ return n;
+};
+
+Richfaces.next = function(node) {
+ var n = node;
+ do {
+ n = n.nextSibling;
+ } while (n && n.nodeType != 1);
+
+ return n;
+};
+
+Richfaces.previous = function(node) {
+ var n = node;
+ do {
+ n = n.previousSibling;
+ } while (n && n.nodeType != 1);
+
+ return n;
+};
+
+Richfaces.removeNode = function(node) {
+ if (node) {
+ var parentNode = node.parentNode;
+ if (parentNode) {
+ parentNode.removeChild(node);
+ }
+ }
+}