mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 02:31:14 +01:00
added init event to scm main
This commit is contained in:
@@ -52,6 +52,14 @@ var loginCallbacks = [];
|
|||||||
*/
|
*/
|
||||||
var logoutCallbacks = [];
|
var logoutCallbacks = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* functions called after initialisation
|
||||||
|
*/
|
||||||
|
var initCallbacks = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base url for the rest api
|
||||||
|
*/
|
||||||
var restUrl = "api/rest/";
|
var restUrl = "api/rest/";
|
||||||
|
|
||||||
var userSearchStore = new Ext.data.JsonStore({
|
var userSearchStore = new Ext.data.JsonStore({
|
||||||
|
|||||||
@@ -62,12 +62,16 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, {
|
|||||||
mainTabPanel: null,
|
mainTabPanel: null,
|
||||||
|
|
||||||
constructor : function(config) {
|
constructor : function(config) {
|
||||||
this.addEvents('login', 'logout');
|
this.addEvents('login', 'logout', 'init');
|
||||||
this.mainTabPanel = Ext.getCmp('mainTabPanel');
|
this.mainTabPanel = Ext.getCmp('mainTabPanel');
|
||||||
this.addListener('login', this.postLogin, this);
|
this.addListener('login', this.postLogin, this);
|
||||||
Sonia.scm.Main.superclass.constructor.call(this, config);
|
Sonia.scm.Main.superclass.constructor.call(this, config);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
init: function(){
|
||||||
|
this.fireEvent('load', this);
|
||||||
|
},
|
||||||
|
|
||||||
postLogin: function(){
|
postLogin: function(){
|
||||||
this.createMainMenu();
|
this.createMainMenu();
|
||||||
this.createRepositoryPanel();
|
this.createRepositoryPanel();
|
||||||
@@ -357,7 +361,6 @@ Ext.onReady(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
main = new Sonia.scm.Main();
|
main = new Sonia.scm.Main();
|
||||||
main.checkLogin();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a tab to main TabPanel
|
* Adds a tab to main TabPanel
|
||||||
@@ -368,7 +371,10 @@ Ext.onReady(function(){
|
|||||||
main.addTabPanel(id, xtype, title);
|
main.addTabPanel(id, xtype, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main.addListeners('init', initCallbacks);
|
||||||
main.addListeners('login', loginCallbacks);
|
main.addListeners('login', loginCallbacks);
|
||||||
main.addListeners('logout', logoutCallbacks);
|
main.addListeners('logout', logoutCallbacks);
|
||||||
|
|
||||||
|
main.init();
|
||||||
|
main.checkLogin();
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user