added init event to scm main

This commit is contained in:
Sebastian Sdorra
2011-04-29 08:37:57 +02:00
parent 6ba58a5548
commit 5cede455ae
2 changed files with 16 additions and 2 deletions

View File

@@ -62,11 +62,15 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, {
mainTabPanel: null,
constructor : function(config) {
this.addEvents('login', 'logout');
this.addEvents('login', 'logout', 'init');
this.mainTabPanel = Ext.getCmp('mainTabPanel');
this.addListener('login', this.postLogin, this);
Sonia.scm.Main.superclass.constructor.call(this, config);
},
init: function(){
this.fireEvent('load', this);
},
postLogin: function(){
this.createMainMenu();
@@ -357,7 +361,6 @@ Ext.onReady(function(){
});
main = new Sonia.scm.Main();
main.checkLogin();
/**
* Adds a tab to main TabPanel
@@ -368,7 +371,10 @@ Ext.onReady(function(){
main.addTabPanel(id, xtype, title);
}
main.addListeners('init', initCallbacks);
main.addListeners('login', loginCallbacks);
main.addListeners('logout', logoutCallbacks);
main.init();
main.checkLogin();
});