Loading template/app/controller/Tabs.js +28 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,26 @@ Ext.define('Docs.controller.Tabs', { ], refs: [ { ref: 'welcomeIndex', selector: '#welcomeindex' }, { ref: 'classIndex', selector: '#classindex' }, { ref: 'guideIndex', selector: '#guideindex' }, { ref: 'videoIndex', selector: '#videoindex' }, { ref: 'exampleIndex', selector: '#exampleindex' }, { ref: 'classTree', selector: '#classtree' Loading Loading @@ -90,6 +110,14 @@ Ext.define('Docs.controller.Tabs', { // Open all tabs from previous session onLaunch: function() { this.getDoctabs().setStaticTabs(Ext.Array.filter([ this.getWelcomeIndex().getTab(), this.getClassIndex().getTab(), this.getGuideIndex().getTab(), this.getVideoIndex().getTab(), this.getExampleIndex().getTab() ], function(x){return x;})); var tabs = Docs.Settings.get('tabs'); if (tabs) { Ext.Array.forEach(tabs, function(url) { Loading template/app/view/DocTree.js +3 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,9 @@ Ext.define('Docs.view.DocTree', { // Expand the main tree this.root.expanded = true; if (this.root.children[0]) { this.root.children[0].expanded = true; } this.on("itemclick", this.onItemClick, this); Loading template/app/view/Tabs.js +14 −8 Original line number Diff line number Diff line Loading @@ -16,14 +16,7 @@ Ext.define('Docs.view.Tabs', { tabs: [], tabsInBar: [], tabCache: {}, staticTabs: [ { cls: 'index', href: '#', tooltip: 'Home' }, { cls: 'classes', href: '#!/api', tooltip: 'API documentation' }, { cls: 'guides', href: '#!/guide', tooltip: 'Guides' }, { cls: 'videos', href: '#!/video', tooltip: 'Videos' }, { cls: 'examples', href: '#!/example', tooltip: 'Examples' } ], staticTabs: [], initComponent: function() { this.tpl = Ext.create('Ext.XTemplate', Loading Loading @@ -64,6 +57,19 @@ Ext.define('Docs.view.Tabs', { } }, /** * Sets the static tabs to display. * * @param {Object[]} tabs Array of tab configs with the following structure: * @param {String} tabs.cls CSS classname for tab * @param {String} tabs.href URL to activate when clicking tab * @param {String} tabs.tooltip Tooltip to show when hovering the tab */ setStaticTabs: function(tabs) { this.staticTabs = tabs; this.refresh(); }, /** * Adds a new tab * Loading template/app/view/cls/Index.js +8 −0 Original line number Diff line number Diff line Loading @@ -26,5 +26,13 @@ Ext.define('Docs.view.cls.Index', { }; this.callParent(arguments); }, /** * Returns tab config for classes page. * @return {Object} */ getTab: function() { return {cls: 'classes', href: '#!/api', tooltip: 'API Documentation'}; } }); template/app/view/examples/Index.js +8 −0 Original line number Diff line number Diff line Loading @@ -36,5 +36,13 @@ Ext.define('Docs.view.examples.Index', { ]; this.callParent(arguments); }, /** * Returns tab config for examples page. * @return {Object} */ getTab: function() { return Docs.data.examples.length > 0 ? {cls: 'examples', href: '#!/example', tooltip: 'Examples'} : false; } }); Loading
template/app/controller/Tabs.js +28 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,26 @@ Ext.define('Docs.controller.Tabs', { ], refs: [ { ref: 'welcomeIndex', selector: '#welcomeindex' }, { ref: 'classIndex', selector: '#classindex' }, { ref: 'guideIndex', selector: '#guideindex' }, { ref: 'videoIndex', selector: '#videoindex' }, { ref: 'exampleIndex', selector: '#exampleindex' }, { ref: 'classTree', selector: '#classtree' Loading Loading @@ -90,6 +110,14 @@ Ext.define('Docs.controller.Tabs', { // Open all tabs from previous session onLaunch: function() { this.getDoctabs().setStaticTabs(Ext.Array.filter([ this.getWelcomeIndex().getTab(), this.getClassIndex().getTab(), this.getGuideIndex().getTab(), this.getVideoIndex().getTab(), this.getExampleIndex().getTab() ], function(x){return x;})); var tabs = Docs.Settings.get('tabs'); if (tabs) { Ext.Array.forEach(tabs, function(url) { Loading
template/app/view/DocTree.js +3 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,9 @@ Ext.define('Docs.view.DocTree', { // Expand the main tree this.root.expanded = true; if (this.root.children[0]) { this.root.children[0].expanded = true; } this.on("itemclick", this.onItemClick, this); Loading
template/app/view/Tabs.js +14 −8 Original line number Diff line number Diff line Loading @@ -16,14 +16,7 @@ Ext.define('Docs.view.Tabs', { tabs: [], tabsInBar: [], tabCache: {}, staticTabs: [ { cls: 'index', href: '#', tooltip: 'Home' }, { cls: 'classes', href: '#!/api', tooltip: 'API documentation' }, { cls: 'guides', href: '#!/guide', tooltip: 'Guides' }, { cls: 'videos', href: '#!/video', tooltip: 'Videos' }, { cls: 'examples', href: '#!/example', tooltip: 'Examples' } ], staticTabs: [], initComponent: function() { this.tpl = Ext.create('Ext.XTemplate', Loading Loading @@ -64,6 +57,19 @@ Ext.define('Docs.view.Tabs', { } }, /** * Sets the static tabs to display. * * @param {Object[]} tabs Array of tab configs with the following structure: * @param {String} tabs.cls CSS classname for tab * @param {String} tabs.href URL to activate when clicking tab * @param {String} tabs.tooltip Tooltip to show when hovering the tab */ setStaticTabs: function(tabs) { this.staticTabs = tabs; this.refresh(); }, /** * Adds a new tab * Loading
template/app/view/cls/Index.js +8 −0 Original line number Diff line number Diff line Loading @@ -26,5 +26,13 @@ Ext.define('Docs.view.cls.Index', { }; this.callParent(arguments); }, /** * Returns tab config for classes page. * @return {Object} */ getTab: function() { return {cls: 'classes', href: '#!/api', tooltip: 'API Documentation'}; } });
template/app/view/examples/Index.js +8 −0 Original line number Diff line number Diff line Loading @@ -36,5 +36,13 @@ Ext.define('Docs.view.examples.Index', { ]; this.callParent(arguments); }, /** * Returns tab config for examples page. * @return {Object} */ getTab: function() { return Docs.data.examples.length > 0 ? {cls: 'examples', href: '#!/example', tooltip: 'Examples'} : false; } });