Author: sergeyhalipov
Date: 2007-03-23 12:51:36 -0400 (Fri, 23 Mar 2007)
New Revision: 131
Modified:
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
Log:
Small optimize finding main TR for tree node.
Modified:
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
---
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-03-23
16:16:13 UTC (rev 130)
+++
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-03-23
16:51:36 UTC (rev 131)
@@ -47,6 +47,7 @@
($(this.id)).object = this;
this.childs = [];
var childsRowId = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW;
+ var mainRowId = this.id + Tree.ID_DEVIDER + Tree.ID_MAIN_ROW;
this.elements.row = $(childsRowId);
var handleId = this.id + Tree.ID_DEVIDER + Tree.ID_HANDLE;
this.elements.handle = $(handleId);
@@ -69,13 +70,8 @@
}
}
}
- var parent = this.elements.handle;
- while (parent) {
- parent = parent.parentNode;
- if (parent.nodeName.toLowerCase() == "tr")
- break;
- }
- this.elements.mainRow = parent;
+
+ this.elements.mainRow = $(mainRowId);
},
addChild: function(child) {
Modified:
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
---
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-03-23
16:16:13 UTC (rev 130)
+++
trunk/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-03-23
16:51:36 UTC (rev 131)
@@ -12,6 +12,7 @@
Tree.ID_HANDLE_IMG_COLLAPSED = "img:collapsed";
Tree.ID_ICON = "icon";
Tree.ID_TEXT = "text";
+Tree.ID_MAIN_ROW = "mainRow";
Tree.CLASS_ITEM_SELECTED = "dr-tree-i-sel";
Tree.CLASS_ITEM_EXPANDED = "dr-tree-h-ic-line-exp";
Tree.CLASS_ITEM_COLLAPSED = "dr-tree-h-ic-line-clp";
Modified: trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-03-23 16:16:13 UTC (rev
130)
+++ trunk/richfaces/tree/src/main/templates/htmlTreeNode.jspx 2007-03-23 16:51:36 UTC (rev
131)
@@ -32,7 +32,7 @@
<f:call name="initializeLines" />
<f:call name="initializeResources" />
- <tr>
+ <tr id="#{clientId}:mainRow" >
<f:call name="encodeAttributeParameters" />
<td class="dr-tree-h-ic #{line}" style="width: 16px;">
<div style="width: 16px;">
Show replies by date