Re-introduce menu on the result page

This commit is contained in:
Gaël Métais
2014-12-21 11:42:09 +01:00
parent 3dc4f4641c
commit ed4f448370
7 changed files with 50 additions and 5 deletions
+34
View File
@@ -0,0 +1,34 @@
var menuService = angular.module('menuService', []);
menuService.factory('Menu', ['$location', function($location) {
var currentPage, currentRunId;
return {
getCurrentPage: function() {
return currentPage;
},
setCurrentPage: function(page, runId) {
currentPage = page;
currentRunId = runId;
return this;
},
changePage: function(page) {
switch (page) {
case 'index':
$location.path('/');
break;
case 'dashboard':
$location.path('/result/' + currentRunId);
break;
case 'timeline':
$location.path('/result/' + currentRunId + '/timeline');
break;
default:
console.err('Undefined Menu.changePage() destination');
}
}
}
}]);