Loading template/app/Application.js +0 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ Ext.define('Docs.Application', { controllers: [ 'Welcome', 'Content', 'Classes', 'Search', 'InlineExamples', Loading template/app/controller/Classes.js +7 −15 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ */ Ext.define('Docs.controller.Classes', { extend: 'Docs.controller.Content', baseUrl: '#!/api', title: 'Classes', requires: [ 'Docs.History', Loading @@ -22,6 +24,10 @@ Ext.define('Docs.controller.Classes', { ref: 'viewport', selector: '#viewport' }, { ref: 'index', selector: '#classindex' }, { ref: 'header', selector: 'classheader' Loading Loading @@ -85,14 +91,6 @@ Ext.define('Docs.controller.Classes', { } }, 'classindex': { afterrender: function(cmp) { cmp.el.addListener('scroll', function(cmp, el) { this.setScrollState('#!/api', el.scrollTop); }, this); } }, 'classoverview': { afterrender: function(cmp) { // Expand member when clicked Loading Loading @@ -153,14 +151,8 @@ Ext.define('Docs.controller.Classes', { * @param {Boolean} noHistory true to disable adding entry to browser history */ loadIndex: function(noHistory) { if (!noHistory) { Docs.History.push("#!/api"); } this.getViewport().setPageTitle("Classes"); Ext.getCmp('doctabs').activateTab('#!/api'); Ext.getCmp('treecontainer').showTree('classtree'); Ext.getCmp('card-panel').layout.setActiveItem('classindex'); Ext.getCmp('classindex').getEl().scrollTo('top', this.getScrollState("#!/api")); this.callParent(arguments); }, /** Loading template/app/controller/Content.js +27 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,33 @@ Ext.define('Docs.controller.Content', { // Code for the middle mouse button MIDDLE: 1, /** * @cfg {String} baseUrl (required) * The base URL of pages served by this controller. */ /** * @cfg {String} title * Title to display while index view active. */ title: "", onLaunch: function() { this.getIndex().on('afterrender', function() { cmp.el.addListener('scroll', function(cmp, el) { this.setScrollState(this.baseUrl, el.scrollTop); }, this); }, this); }, loadIndex: function(noHistory) { noHistory || Docs.History.push(this.baseUrl); this.getViewport().setPageTitle(this.title); Ext.getCmp('doctabs').activateTab(this.baseUrl); Ext.getCmp('card-panel').layout.setActiveItem(this.getIndex()); this.getIndex().getEl().scrollTo('top', this.getScrollState("#")); }, // True when middle mouse button pressed or shift/ctrl key pressed // together with mouse button (for Mac) opensNewWindow: function(event) { Loading template/app/controller/Examples.js +7 −12 Original line number Diff line number Diff line Loading @@ -3,12 +3,18 @@ */ Ext.define('Docs.controller.Examples', { extend: 'Docs.controller.Content', baseUrl: '#!/example', title: 'Examples', refs: [ { ref: 'viewport', selector: '#viewport' }, { ref: 'index', selector: '#exampleindex' }, { ref: 'tree', selector: '#exampletree' Loading @@ -31,13 +37,6 @@ Ext.define('Docs.controller.Examples', { this.loadExample(url); } }, 'exampleindex': { afterrender: function(cmp) { cmp.el.addListener('scroll', function(cmp, el) { this.setScrollState('#!/example', el.scrollTop); }, this); } }, 'exampleindex > thumblist': { urlclick: function(url) { this.loadExample(url); Loading @@ -47,12 +46,8 @@ Ext.define('Docs.controller.Examples', { }, loadIndex: function() { Docs.History.push("#!/example"); this.getViewport().setPageTitle("Examples"); Ext.getCmp('doctabs').activateTab('#!/example'); Ext.getCmp('card-panel').layout.setActiveItem('exampleindex'); Ext.getCmp('treecontainer').showTree('exampletree'); Ext.getCmp('exampleindex').getEl().scrollTo('top', this.getScrollState("#!/example")); this.callParent(); }, loadExample: function(url, noHistory) { Loading template/app/controller/Guides.js +7 −12 Original line number Diff line number Diff line Loading @@ -3,12 +3,18 @@ */ Ext.define('Docs.controller.Guides', { extend: 'Docs.controller.Content', baseUrl: '#!/guide', title: 'Guides', refs: [ { ref: 'viewport', selector: '#viewport' }, { ref: 'index', selector: '#guideindex' }, { ref: 'tree', selector: '#guidetree' Loading @@ -33,13 +39,6 @@ Ext.define('Docs.controller.Guides', { this.handleUrlClick(url, event, this.getTree()); } }, 'guideindex': { afterrender: function(cmp) { cmp.el.addListener('scroll', function(cmp, el) { this.setScrollState('#!/guide', el.scrollTop); }, this); } }, 'guideindex > thumblist': { urlclick: function(url) { this.loadGuide(url); Loading Loading @@ -84,12 +83,8 @@ Ext.define('Docs.controller.Guides', { * Loads the guides index */ loadIndex: function() { Docs.History.push("#!/guide"); this.getViewport().setPageTitle("Guides"); Ext.getCmp('doctabs').activateTab('#!/guide'); Ext.getCmp('card-panel').layout.setActiveItem('guideindex'); Ext.getCmp('treecontainer').showTree('guidetree'); Ext.getCmp('guideindex').getEl().scrollTo('top', this.getScrollState("#!/guide")); this.callParent(); }, /** Loading Loading
template/app/Application.js +0 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ Ext.define('Docs.Application', { controllers: [ 'Welcome', 'Content', 'Classes', 'Search', 'InlineExamples', Loading
template/app/controller/Classes.js +7 −15 Original line number Diff line number Diff line Loading @@ -3,6 +3,8 @@ */ Ext.define('Docs.controller.Classes', { extend: 'Docs.controller.Content', baseUrl: '#!/api', title: 'Classes', requires: [ 'Docs.History', Loading @@ -22,6 +24,10 @@ Ext.define('Docs.controller.Classes', { ref: 'viewport', selector: '#viewport' }, { ref: 'index', selector: '#classindex' }, { ref: 'header', selector: 'classheader' Loading Loading @@ -85,14 +91,6 @@ Ext.define('Docs.controller.Classes', { } }, 'classindex': { afterrender: function(cmp) { cmp.el.addListener('scroll', function(cmp, el) { this.setScrollState('#!/api', el.scrollTop); }, this); } }, 'classoverview': { afterrender: function(cmp) { // Expand member when clicked Loading Loading @@ -153,14 +151,8 @@ Ext.define('Docs.controller.Classes', { * @param {Boolean} noHistory true to disable adding entry to browser history */ loadIndex: function(noHistory) { if (!noHistory) { Docs.History.push("#!/api"); } this.getViewport().setPageTitle("Classes"); Ext.getCmp('doctabs').activateTab('#!/api'); Ext.getCmp('treecontainer').showTree('classtree'); Ext.getCmp('card-panel').layout.setActiveItem('classindex'); Ext.getCmp('classindex').getEl().scrollTo('top', this.getScrollState("#!/api")); this.callParent(arguments); }, /** Loading
template/app/controller/Content.js +27 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,33 @@ Ext.define('Docs.controller.Content', { // Code for the middle mouse button MIDDLE: 1, /** * @cfg {String} baseUrl (required) * The base URL of pages served by this controller. */ /** * @cfg {String} title * Title to display while index view active. */ title: "", onLaunch: function() { this.getIndex().on('afterrender', function() { cmp.el.addListener('scroll', function(cmp, el) { this.setScrollState(this.baseUrl, el.scrollTop); }, this); }, this); }, loadIndex: function(noHistory) { noHistory || Docs.History.push(this.baseUrl); this.getViewport().setPageTitle(this.title); Ext.getCmp('doctabs').activateTab(this.baseUrl); Ext.getCmp('card-panel').layout.setActiveItem(this.getIndex()); this.getIndex().getEl().scrollTo('top', this.getScrollState("#")); }, // True when middle mouse button pressed or shift/ctrl key pressed // together with mouse button (for Mac) opensNewWindow: function(event) { Loading
template/app/controller/Examples.js +7 −12 Original line number Diff line number Diff line Loading @@ -3,12 +3,18 @@ */ Ext.define('Docs.controller.Examples', { extend: 'Docs.controller.Content', baseUrl: '#!/example', title: 'Examples', refs: [ { ref: 'viewport', selector: '#viewport' }, { ref: 'index', selector: '#exampleindex' }, { ref: 'tree', selector: '#exampletree' Loading @@ -31,13 +37,6 @@ Ext.define('Docs.controller.Examples', { this.loadExample(url); } }, 'exampleindex': { afterrender: function(cmp) { cmp.el.addListener('scroll', function(cmp, el) { this.setScrollState('#!/example', el.scrollTop); }, this); } }, 'exampleindex > thumblist': { urlclick: function(url) { this.loadExample(url); Loading @@ -47,12 +46,8 @@ Ext.define('Docs.controller.Examples', { }, loadIndex: function() { Docs.History.push("#!/example"); this.getViewport().setPageTitle("Examples"); Ext.getCmp('doctabs').activateTab('#!/example'); Ext.getCmp('card-panel').layout.setActiveItem('exampleindex'); Ext.getCmp('treecontainer').showTree('exampletree'); Ext.getCmp('exampleindex').getEl().scrollTo('top', this.getScrollState("#!/example")); this.callParent(); }, loadExample: function(url, noHistory) { Loading
template/app/controller/Guides.js +7 −12 Original line number Diff line number Diff line Loading @@ -3,12 +3,18 @@ */ Ext.define('Docs.controller.Guides', { extend: 'Docs.controller.Content', baseUrl: '#!/guide', title: 'Guides', refs: [ { ref: 'viewport', selector: '#viewport' }, { ref: 'index', selector: '#guideindex' }, { ref: 'tree', selector: '#guidetree' Loading @@ -33,13 +39,6 @@ Ext.define('Docs.controller.Guides', { this.handleUrlClick(url, event, this.getTree()); } }, 'guideindex': { afterrender: function(cmp) { cmp.el.addListener('scroll', function(cmp, el) { this.setScrollState('#!/guide', el.scrollTop); }, this); } }, 'guideindex > thumblist': { urlclick: function(url) { this.loadGuide(url); Loading Loading @@ -84,12 +83,8 @@ Ext.define('Docs.controller.Guides', { * Loads the guides index */ loadIndex: function() { Docs.History.push("#!/guide"); this.getViewport().setPageTitle("Guides"); Ext.getCmp('doctabs').activateTab('#!/guide'); Ext.getCmp('card-panel').layout.setActiveItem('guideindex'); Ext.getCmp('treecontainer').showTree('guidetree'); Ext.getCmp('guideindex').getEl().scrollTo('top', this.getScrollState("#!/guide")); this.callParent(); }, /** Loading