Author: pyaschenko
Date: 2009-02-06 10:15:46 -0500 (Fri, 06 Feb 2009)
New Revision: 12593
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.js
Log:
https://jira.jboss.org/jira/browse/RF-4808
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 2009-02-06
15:06:55 UTC (rev 12592)
+++
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2009-02-06
15:15:46 UTC (rev 12593)
@@ -466,26 +466,32 @@
alert(s);
*/
-
- var eText = this.elements.textElement;
- if (!this.selectedTextClassNames)
+ if (e["treeItem"])
{
- this.selectedTextClassNames = Richfaces.getNSAttribute("selectedclass",
eText);
- }
- if (this.selectedTextClassNames) {
- var classNames = this.selectedTextClassNames.split(' ')
- for (var i = 0; i < classNames.length; i++) {
- Element.addClassName(eText, classNames[i]);
- }
- if (this.previousTextClassNames &&
this.previousTextClassNames.indexOf(this.selectedTextClassNames)==-1)
+ var eText = this.elements.textElement;
+ if (!this.selectedTextClassNames)
{
- this.previousTextClassNames += " " + this.selectedTextClassNames;
+ this.selectedTextClassNames = Richfaces.getNSAttribute("selectedclass",
eText);
}
- this.tree.input.value = this.id;
- this.tree.selectionManager.activeItem = this;
-
- if (this.tree.options.onSelection) this.tree.options.onSelection(this.id);
- this.tree.showNode(eText.parentNode);
+ if (this.selectedTextClassNames) {
+ var classNames = this.selectedTextClassNames.split(' ')
+ for (var i = 0; i < classNames.length; i++) {
+ Element.addClassName(eText, classNames[i]);
+ }
+ if (this.previousTextClassNames &&
this.previousTextClassNames.indexOf(this.selectedTextClassNames)==-1)
+ {
+ this.previousTextClassNames += " " + this.selectedTextClassNames;
+ }
+ this.tree.input.value = this.id;
+ this.tree.selectionManager.activeItem = this;
+
+ if (this.tree.options.onSelection) this.tree.options.onSelection(this.id);
+ this.tree.showNode(eText.parentNode);
+ }
+ } else
+ {
+ this.tree.input.value = "";
+ this.tree.selectionManager.activeItem = null;
}
if (e && e["originatingEventType"] == "mousedown" /* can
be keydown */) {
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 2009-02-06
15:06:55 UTC (rev 12592)
+++
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2009-02-06
15:15:46 UTC (rev 12593)
@@ -119,7 +119,7 @@
event["treeItem"] = prevSelection;
if (prevSelection) {
prevSelection.toggleSelection(event);
- }
+ } else treeItem.toggleSelection(event);
return ;
}
@@ -129,7 +129,7 @@
event["treeItem"] = prevSelection;
if (prevSelection) {
prevSelection.toggleSelection(event);
- }
+ } else treeItem.toggleSelection(event);
return ;
}