frontend: update the page title when navigate
This commit is contained in:
parent
56faf7b8db
commit
525b3d6b56
2 changed files with 14 additions and 1 deletions
|
|
@ -414,8 +414,21 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
|
|||
if (exercicesUrl != undefined)
|
||||
$rootScope.current_exercice = exercicesUrl[$routeParams.theme + "/" + $routeParams.exercice];
|
||||
})
|
||||
$scope.$watchGroup(["themes", "current_theme", "current_exercice"], function(newValues) {
|
||||
var themes = newValues[0];
|
||||
var current_theme = newValues[1];
|
||||
var current_exercice = newValues[2];
|
||||
if (themes != undefined && themes[current_theme] != undefined && themes[current_theme].exercices != undefined && themes[current_theme].exercices[current_exercice] != undefined)
|
||||
$rootScope.title = themes[current_theme].name + " > " + themes[current_theme].exercices[current_exercice].title;
|
||||
});
|
||||
} else {
|
||||
$rootScope.current_exercice = 0;
|
||||
$scope.$watchGroup(["themes", "current_theme"], function(newValues) {
|
||||
var themes = newValues[0];
|
||||
var current_theme = newValues[1];
|
||||
if (themes != undefined && themes[current_theme] != undefined)
|
||||
$rootScope.title = themes[current_theme].name;
|
||||
});
|
||||
}
|
||||
|
||||
var cbh;
|
||||
|
|
|
|||
Reference in a new issue