From b18f5bf3c64148d15f601f3573ecdc59484b8a89 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Wed, 24 Aug 2011 18:12:40 -0700 Subject: [PATCH] Make classes page the main page if no welcome page. --- template/app/History.js | 7 ++++++- template/app/controller/Welcome.js | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/template/app/History.js b/template/app/History.js index 83965030..257498e0 100644 --- a/template/app/History.js +++ b/template/app/History.js @@ -59,7 +59,12 @@ Ext.define("Docs.History", { Docs.App.getController('Examples').loadExample(url.url, true); } else { - Docs.App.getController('Welcome').loadIndex(true); + if (Docs.App.getController('Welcome').isActive()) { + Docs.App.getController('Welcome').loadIndex(true); + } + else { + Docs.App.getController('Classes').loadIndex(true); + } } }, diff --git a/template/app/controller/Welcome.js b/template/app/controller/Welcome.js index 99a8215b..3fc26ea4 100644 --- a/template/app/controller/Welcome.js +++ b/template/app/controller/Welcome.js @@ -37,5 +37,13 @@ Ext.define('Docs.controller.Welcome', { ); Ext.getCmp("failure").update(tpl.apply({msg: msg})); Ext.getCmp('card-panel').layout.setActiveItem("failure"); + }, + + /** + * True if welcome page is available. + * @return {Boolean} + */ + isActive: function() { + return !!this.getIndex().getTab(); } }); -- GitLab