4 Ext.define('Docs.ClassTree', {
5 extend: 'Ext.tree.Panel',
14 height: Ext.core.Element.getViewportHeight() - 170,
20 itemclick: function(view, node) {
21 var clsName = node.raw ? node.raw.clsName : node.data.clsName;
24 Docs.ClassLoader.load(clsName);
25 } else if (!node.isLeaf()) {
26 if (node.isExpanded()) {
35 initComponent: function() {
36 // Expand the main tree
37 this.root.expanded = true;
38 this.root.children[0].expanded = true;
39 // Add links for favoriting classes
40 this.addFavIcons(this.root);
45 addFavIcons: function(node) {
47 node.text += '<a rel="'+node.id+'" class="fav"></a>';
50 Ext.Array.forEach(node.children, this.addFavIcons, this);
55 * Selects class node in tree by name.
57 * @param {String} className
59 selectClass: function(className) {
60 var classNode = this.getRootNode().findChildBy(function(n) {
61 return className === n.raw.clsName;
65 this.getSelectionModel().select(classNode);
66 classNode.bubble(function(n) {