From 47f6252ec01bee1c96a6520c8519ff0dda8156a2 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 1 Jun 2013 01:51:52 +0200 Subject: [PATCH] Do not show empty navbar items. --- .../javascripts/app/controllers/_default_navbar.js.coffee | 2 +- app/assets/javascripts/app/controllers/navigation.js.coffee | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_default_navbar.js.coffee b/app/assets/javascripts/app/controllers/_default_navbar.js.coffee index 53f7068b2..4c80707cd 100644 --- a/app/assets/javascripts/app/controllers/_default_navbar.js.coffee +++ b/app/assets/javascripts/app/controllers/_default_navbar.js.coffee @@ -11,4 +11,4 @@ App.Config.set( 'User', { App.Config.set( 'Admin', { prio: 10000, parent: '', name: 'Manage', target: '#admin', role: ['Admin'] }, 'NavBar' ) App.Config.set( 'Setting', { prio: 20000, parent: '', name: 'Settings', target: '#settings', role: ['Admin'] }, 'NavBar' ) -App.Config.set( 'Misc', { prio: 90000, parent: '', name: 'Tools', target: '#tools' }, 'NavBar' ) +App.Config.set( 'Misc', { prio: 90000, parent: '', name: 'Tools', target: '#tools', child: true }, 'NavBar' ) diff --git a/app/assets/javascripts/app/controllers/navigation.js.coffee b/app/assets/javascripts/app/controllers/navigation.js.coffee index 8b706a9c5..91e22ea7a 100644 --- a/app/assets/javascripts/app/controllers/navigation.js.coffee +++ b/app/assets/javascripts/app/controllers/navigation.js.coffee @@ -95,7 +95,7 @@ class App.Navigation extends App.Controller # load user collection if data.load.users App.Collection.load( type: 'User', data: data.load.users ) - + # load user collection if data.load.organizations for organization_id, organization of data.load.organizations @@ -255,7 +255,7 @@ class App.Navigation extends App.Controller newlist[ item['prio'] ] = item; - # get keys for sort order + # get keys for sort order keys = _.keys(newlist) inorder = keys.sort(@sortit) @@ -265,7 +265,7 @@ class App.Navigation extends App.Controller inordervalue.push newlist[ num ] return inordervalue - sortit: (a,b) -> + sortit: (a,b) -> return(a-b) addPrioCount: (newlist, item) ->