mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-26 17:29:12 +01:00
improve sonia.navigation
This commit is contained in:
@@ -30,7 +30,9 @@
|
||||
*/
|
||||
loginCallbacks.push(function(){
|
||||
if (admin){
|
||||
Ext.getCmp('navigationPanel').addSection({
|
||||
var navPanel = Ext.getCmp('navigationPanel');
|
||||
var count = navPanel.count() - 1;
|
||||
navPanel.insertSection(count, {
|
||||
title: 'Development',
|
||||
items: [{
|
||||
label: 'Injection Graph',
|
||||
|
||||
@@ -120,6 +120,18 @@ Sonia.navigation.NavPanel = Ext.extend(Ext.Panel, {
|
||||
}
|
||||
},
|
||||
|
||||
insertSection: function(pos, section){
|
||||
if ( debug ){
|
||||
console.debug('insert navsection ' + section.title + ' at ' + pos);
|
||||
}
|
||||
this.insert(pos,{
|
||||
xtype: 'navSection',
|
||||
title: section.title,
|
||||
data: section.items
|
||||
});
|
||||
this.doLayout();
|
||||
},
|
||||
|
||||
addSections: function(sections){
|
||||
if ( Ext.isArray( sections ) && sections.length > 0 ){
|
||||
for ( var i=0; i<sections.length; i++ ){
|
||||
@@ -132,11 +144,18 @@ Sonia.navigation.NavPanel = Ext.extend(Ext.Panel, {
|
||||
},
|
||||
|
||||
addSection: function(section){
|
||||
if ( debug ){
|
||||
console.debug('add navsection ' + section.title);
|
||||
}
|
||||
this.add({
|
||||
xtype: 'navSection',
|
||||
title: section.title,
|
||||
data: section.items
|
||||
});
|
||||
},
|
||||
|
||||
count: function(){
|
||||
return this.items.length;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -179,7 +179,7 @@ Ext.onReady(function(){
|
||||
// register login callbacks
|
||||
|
||||
// create menu
|
||||
loginCallbacks.push( createMainMenu );
|
||||
loginCallbacks.splice(0, 0, createMainMenu );
|
||||
// add welcome tab
|
||||
loginCallbacks.push( createWelcomePanel );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user