Author: nbelaevski
Date: 2008-09-02 20:12:59 -0400 (Tue, 02 Sep 2008)
New Revision: 10286
Modified:
trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
Small refactoring
Modified: trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2008-09-02
18:19:55 UTC (rev 10285)
+++ trunk/ui/tree/src/main/java/org/richfaces/renderkit/NodeRendererBase.java 2008-09-03
00:12:59 UTC (rev 10286)
@@ -66,7 +66,7 @@
String id = treeNode.getClientId(context);
StringBuilder script = new StringBuilder();
- script.append("Tree.");
+ script.append("Tree.Item.");
boolean expanded = tree.isExpanded();
if (expanded) {
script.append("fireCollapsionEvent(this);");
Modified:
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
---
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2008-09-02
18:19:55 UTC (rev 10285)
+++
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2008-09-03
00:12:59 UTC (rev 10286)
@@ -1,5 +1,22 @@
Tree.Item = Class.create();
+Tree.Item.findComponent = function(elt) {
+ while (elt && (!elt.tagName || elt.tagName.toLowerCase() != 'table')) {
+ elt = elt.parentNode;
+ }
+
+ return elt.object;
+};
+
+Tree.Item.fireCollapsionEvent = function(elt) {
+ return Tree.Item.findComponent(elt).fireCollapsionEvent();
+};
+
+Tree.Item.fireExpansionEvent = function(elt) {
+ return Tree.Item.findComponent(elt).fireExpansionEvent();
+};
+
+
Tree.Item.prototype = {
initialize: function(id, tree, parent, ajaxUpdate) {
this.parent = parent;
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
---
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-09-02
18:19:55 UTC (rev 10285)
+++
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2008-09-03
00:12:59 UTC (rev 10286)
@@ -19,22 +19,6 @@
Tree.CLASS_ITEM_COLLAPSED = "dr-tree-h-ic-line-clp";
Tree.CLASS_AJAX_SELECTED_LISTENER_FLAG = "ajax_selected_listener_flag";
-Tree.findComponent = function(elt) {
- while (elt && (!elt.tagName || elt.tagName.toLowerCase() != 'table')) {
- elt = elt.parentNode;
- }
-
- return elt.object;
-};
-
-Tree.fireCollapsionEvent = function(elt) {
- return Tree.findComponent(elt).fireCollapsionEvent();
-};
-
-Tree.fireExpansionEvent = function(elt) {
- return Tree.findComponent(elt).fireExpansionEvent();
-};
-
Tree.prototype = {
initialize: function(id, input, switchType, events, onAjaxSelect, toggleOnClick,
showConnectingLines) {
this.childs = [];
Show replies by date