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 <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-08-18 14:04:04 +02:00 committed by Dietmar Maurer
parent fc7de588fd
commit 033228c06d
3 changed files with 2 additions and 6 deletions

View File

@ -3,9 +3,6 @@ Ext.define('PMG.Application', {
name: 'PMG',
// default fragment for the router
defaultToken: 'pmgDashboard',
stores: [
'NavigationStore'
],

View File

@ -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);
}

View File

@ -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);
}
}