Re-construct the JS Timeline page

This commit is contained in:
Gaël Métais
2014-12-22 14:07:16 +01:00
parent c1257afc4c
commit cb20075599
19 changed files with 890 additions and 570 deletions
+14 -5
View File
@@ -1,15 +1,24 @@
var dashboardCtrl = angular.module('dashboardCtrl', ['resultsFactory', 'menuService']);
dashboardCtrl.controller('DashboardCtrl', ['$scope', '$routeParams', '$location', 'Results', 'Menu', function($scope, $routeParams, $location, Results, Menu) {
dashboardCtrl.controller('DashboardCtrl', ['$scope', '$rootScope', '$routeParams', '$location', 'Results', 'Menu', function($scope, $rootScope, $routeParams, $location, Results, Menu) {
$scope.runId = $routeParams.runId;
$scope.Menu = Menu.setCurrentPage('dashboard', $scope.runId);
Results.get({runId: $routeParams.runId}, function(result) {
$scope.result = result;
console.log(result);
});
function loadResults() {
// Load result if needed
if (!$rootScope.loadedResult || $rootScope.loadedResult.runId !== $routeParams.runId) {
Results.get({runId: $routeParams.runId}, function(result) {
$rootScope.loadedResult = result;
$scope.result = result;
});
} else {
$scope.result = $rootScope.loadedResult;
}
}
$scope.showRulePage = function(ruleName) {
$location.path('/result/' + $scope.runId + '/rule/' + ruleName);
};
loadResults();
}]);