Loading template/app/controller/Examples.js +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ Ext.define('Docs.controller.Examples', { refs: [ { ref: 'tree', selector: 'exampletree' selector: '#exampletree' } ], Loading @@ -22,7 +22,7 @@ Ext.define('Docs.controller.Examples', { ); this.control({ 'exampletree': { '#exampletree': { urlclick: function(url, event) { this.loadExample(url); } Loading template/app/controller/Guides.js +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ Ext.define('Docs.controller.Guides', { }, { ref: 'tree', selector: 'guidetree' selector: '#guidetree' } ], Loading @@ -28,7 +28,7 @@ Ext.define('Docs.controller.Guides', { ); this.control({ 'guidetree': { '#guidetree': { urlclick: function(url, event) { this.handleUrlClick(url, event, this.getTree()); } Loading template/app/controller/Tabs.js +3 −3 Original line number Diff line number Diff line Loading @@ -11,15 +11,15 @@ Ext.define('Docs.controller.Tabs', { }, { ref: 'guideTree', selector: 'guidetree' selector: '#guidetree' }, { ref: 'exampleTree', selector: 'exampletree' selector: '#exampletree' }, { ref: 'videoTree', selector: 'videotree' selector: '#videotree' } ], Loading template/app/controller/Videos.js +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ Ext.define('Docs.controller.Videos', { ); this.control({ 'videotree': { '#videotree': { urlclick: function(url) { this.loadVideo(url); } Loading template/app/view/GroupTree.js 0 → 100644 +42 −0 Original line number Diff line number Diff line /** * A tree for guides/videos/examples. * * Each of these has similar dataset that consists of groups. * Only the actual items (that are grouped) differ. * This class applies a conversion function for each item. */ Ext.define('Docs.view.GroupTree', { extend: 'Docs.view.DocTree', alias: 'widget.grouptree', /** * @cfg {Object[]} data (required) * An array of guoups. Each group is object with properties: * @cfg {String} title * @cfg {Object[]} items */ /** * @cfg {Function} convert (required) * A function that converts items to tree nodes * @cfg {Object} convert.item The item to convert * @cfg {Object} convert.return The treenode config */ initComponent: function() { this.root = { children: [], text: 'Root' }; Ext.Array.each(this.data, function(group) { this.root.children.push({ text: group.title, children: Ext.Array.map(group.items, this.convert), iconCls: 'icon-pkg' }); }, this); this.callParent(); } }); Loading
template/app/controller/Examples.js +2 −2 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ Ext.define('Docs.controller.Examples', { refs: [ { ref: 'tree', selector: 'exampletree' selector: '#exampletree' } ], Loading @@ -22,7 +22,7 @@ Ext.define('Docs.controller.Examples', { ); this.control({ 'exampletree': { '#exampletree': { urlclick: function(url, event) { this.loadExample(url); } Loading
template/app/controller/Guides.js +2 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ Ext.define('Docs.controller.Guides', { }, { ref: 'tree', selector: 'guidetree' selector: '#guidetree' } ], Loading @@ -28,7 +28,7 @@ Ext.define('Docs.controller.Guides', { ); this.control({ 'guidetree': { '#guidetree': { urlclick: function(url, event) { this.handleUrlClick(url, event, this.getTree()); } Loading
template/app/controller/Tabs.js +3 −3 Original line number Diff line number Diff line Loading @@ -11,15 +11,15 @@ Ext.define('Docs.controller.Tabs', { }, { ref: 'guideTree', selector: 'guidetree' selector: '#guidetree' }, { ref: 'exampleTree', selector: 'exampletree' selector: '#exampletree' }, { ref: 'videoTree', selector: 'videotree' selector: '#videotree' } ], Loading
template/app/controller/Videos.js +1 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ Ext.define('Docs.controller.Videos', { ); this.control({ 'videotree': { '#videotree': { urlclick: function(url) { this.loadVideo(url); } Loading
template/app/view/GroupTree.js 0 → 100644 +42 −0 Original line number Diff line number Diff line /** * A tree for guides/videos/examples. * * Each of these has similar dataset that consists of groups. * Only the actual items (that are grouped) differ. * This class applies a conversion function for each item. */ Ext.define('Docs.view.GroupTree', { extend: 'Docs.view.DocTree', alias: 'widget.grouptree', /** * @cfg {Object[]} data (required) * An array of guoups. Each group is object with properties: * @cfg {String} title * @cfg {Object[]} items */ /** * @cfg {Function} convert (required) * A function that converts items to tree nodes * @cfg {Object} convert.item The item to convert * @cfg {Object} convert.return The treenode config */ initComponent: function() { this.root = { children: [], text: 'Root' }; Ext.Array.each(this.data, function(group) { this.root.children.push({ text: group.title, children: Ext.Array.map(group.items, this.convert), iconCls: 'icon-pkg' }); }, this); this.callParent(); } });