TreeController.prototype.openElement = function()

in src/main/resources/SLING-INF/libs/sling/resource-editor/static/js/tree/TreeController.js [201:220]


	TreeController.prototype.openElement = function(root, paths) {
		var thisTreeController = this;
		var pathElementName = paths.shift();
		var pathElementLi = root.children("[nodename='"+pathElementName+"']");
		if (pathElementLi.length === 0){
			alert("Couldn't find "+pathElementName+" under the path "+this.getPathFromLi(root.parent()));
		} else {
			$(this.settings.treeAndPropsSelector).jstree('open_node', pathElementLi,
					function(){
						if (paths.length>0){
							thisTreeController.openElement($("#"+pathElementLi.attr('id')).children("ul"), paths);
						} else  {
							$(thisTreeController.settings.treeAndPropsSelector).jstree('select_node', pathElementLi.attr('id'), 'true');
					        var target = $('#'+pathElementLi.attr('id')+' a:first');
					        target.focus();
						}
					}
				);
		}
	}