From 033228c06d40b730d1508868ac245e5fdab061dd Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 18 Aug 2017 14:04:04 +0200 Subject: [PATCH] let the default token be chosen by the view instead of the application, since we want a different default token for the admin view and the quarantine view Signed-off-by: Dominik Csapak --- js/Application.js | 3 --- js/MainView.js | 2 +- js/QuarantineView.js | 3 +-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/js/Application.js b/js/Application.js index 05714e9..9d8bf66 100644 --- a/js/Application.js +++ b/js/Application.js @@ -3,9 +3,6 @@ Ext.define('PMG.Application', { name: 'PMG', - // default fragment for the router - defaultToken: 'pmgDashboard', - stores: [ 'NavigationStore' ], diff --git a/js/MainView.js b/js/MainView.js index a4211df..4b4a22c 100644 --- a/js/MainView.js +++ b/js/MainView.js @@ -142,7 +142,7 @@ Ext.define('PMG.MainView', { }); // select treeitem and load page from url fragment - var token = Ext.util.History.getToken(); + var token = Ext.util.History.getToken() || 'pmgDashboard'; this.redirectTo(token, true); } diff --git a/js/QuarantineView.js b/js/QuarantineView.js index 277b803..3855b4f 100644 --- a/js/QuarantineView.js +++ b/js/QuarantineView.js @@ -179,8 +179,7 @@ Ext.define('PMG.QuarantineView', { me.execQuarantineAction(qa); } else { // select treeitem and load page from url fragment - var token = Ext.util.History.getToken(); - if (!token || token === 'pmgDashboard') token = 'pmgSpamQuarantine'; // hack + var token = Ext.util.History.getToken() || 'pmgSpamQuarantine'; this.redirectTo(token, true); } }