Index: branches/5.0.x/core/admin_templates/js/tree.js =================================================================== diff -u -r12117 -r12382 --- branches/5.0.x/core/admin_templates/js/tree.js (.../tree.js) (revision 12117) +++ branches/5.0.x/core/admin_templates/js/tree.js (.../tree.js) (revision 12382) @@ -133,8 +133,11 @@ } else { // ensures, that click is made before AJAX request will be sent - if (res === true) { - // only in case of "true" is returned, used in catalog + var $res_type = Object.prototype.toString.call(res); + + if ((res === true) || ($res_type == '[object Object]')) { + // in case of "true" is returned, used in catalog + // in case of object (tree node) is returned, used in advanced view if (this.treeItem.isContainer()) { this.href = this.treeItem.locateFirstItem().Url; } @@ -145,7 +148,15 @@ if (!this.treeItem.Expanded && this.treeItem.isFolder()) { if (this.treeItem.folderClick()); } - this.treeItem.highLight(); + + if ($res_type == '[object Object]') { + // highlight returned tree node instead of clicked one + res.highLight(false); // don't expand such node + } + else { + this.treeItem.highLight(); + } + return false; } } @@ -167,7 +178,7 @@ TreeItem.prototype.display = function() { - this.Tr.style.display = is.ie ? 'block' : 'table-row'; + this.Tr.style.display = ''; // is.ie ? 'block' : 'table-row'; this.Displayed = true; var do_sub = TreeManager.isExpanded(this.Key); @@ -186,21 +197,29 @@ this.Displayed = false; } -TreeItem.prototype.highLight = function() +TreeItem.prototype.highLight = function($auto_expand) { - if (last_hightlighted) last_hightlighted.Tr.className = ''; + if ($auto_expand === undefined) { + $auto_expand = true; + } + + if (last_hightlighted) { + last_hightlighted.Tr.className = ''; + } + if (this.Children && this.Children.length > 0 && this.isContainer()) { - if (!this.Expanded) { + if (!this.Expanded && $auto_expand) { this.expand(); } - this.Children[0].highLight(); + + this.Children[0].highLight($auto_expand); return; } this.Tr.className = "highlighted"; last_hightlighted = this; last_highlighted_key = this.Key; - if (!this.Expanded) { + if (!this.Expanded && $auto_expand) { this.expand(); } }