frontend: fix race condition in interface
This commit is contained in:
parent
129baaacee
commit
bd0416eede
1 changed files with 8 additions and 2 deletions
|
|
@ -182,10 +182,16 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
||||||
$rootScope.refresh();
|
$rootScope.refresh();
|
||||||
})
|
})
|
||||||
.controller("ExerciceController", function($scope, $routeParams, $http, $rootScope, $timeout) {
|
.controller("ExerciceController", function($scope, $routeParams, $http, $rootScope, $timeout) {
|
||||||
$rootScope.current_theme = $scope.themesUrl[$routeParams.theme];
|
$scope.$watch("themesUrl", function(themesUrl) {
|
||||||
|
if (themesUrl != undefined)
|
||||||
|
$rootScope.current_theme = themesUrl[$routeParams.theme];
|
||||||
|
})
|
||||||
|
|
||||||
if ($routeParams.exercice) {
|
if ($routeParams.exercice) {
|
||||||
$rootScope.current_exercice = $scope.exercicesUrl[$routeParams.exercice];
|
$scope.$watch("exercicesUrl", function(exercicesUrl) {
|
||||||
|
if (exercicesUrl != undefined)
|
||||||
|
$rootScope.current_exercice = exercicesUrl[$routeParams.exercice];
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
if ($scope.themes && $scope.my && $scope.themes[$scope.current_theme]) {
|
if ($scope.themes && $scope.my && $scope.themes[$scope.current_theme]) {
|
||||||
var exos = Object.keys($scope.themes[$scope.current_theme].exercices);
|
var exos = Object.keys($scope.themes[$scope.current_theme].exercices);
|
||||||
|
|
|
||||||
Reference in a new issue