Skip to content
Snippets Groups Projects
Commit d7e873c4 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

use a switch statement instead of multiple else-ifs.

parent 6fb74802
No related branches found
No related tags found
No related merge requests found
......@@ -133,15 +133,11 @@ CorvusControllers.controller('Nav', ['$scope', '$routeParams', '$location', 'App
}
var setNavContext = function(context) {
if(context === 'org-admin') {
$scope.nav = 'admin';
} else if (context === 'setup') {
$scope.nav = 'setup';
} else if (context === 'site-admin') {
$scope.nav = 'superadmin';
} else {
// this covers 'org', 'auth', and 'unknown' contexts
$scope.nav = 'main';
switch(context) {
case "site-admin": $scope.nav = 'superadmin'; break;
case "setup": $scope.nav = 'setup'; break;
case "org-admin": $scope.nav = 'admin'; break;
default: $scope.nav = 'main';
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment