frontend: add active class on tag menu

This commit is contained in:
nemunaire 2018-11-25 05:48:44 +01:00
parent c11f2403d2
commit 521507b8e3
2 changed files with 11 additions and 2 deletions

View file

@ -45,6 +45,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
.run(function($rootScope, $interval) {
$rootScope.current_theme = 0;
$rootScope.current_exercice = 0;
$rootScope.current_tag = undefined;
$rootScope.time = {};
$rootScope.recvTime = function(response) {
@ -197,6 +198,8 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
if (window.scrollY > 112)
window.scrollTo(window.scrollX, 112);
$rootScope.current_tag = undefined;
$scope.$watch("themesUrl", function(themesUrl) {
if (themesUrl != undefined)
$rootScope.current_theme = themesUrl[$routeParams.theme];
@ -338,6 +341,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
.controller("MyTeamController", function($scope, $http, $rootScope, $timeout) {
$rootScope.current_theme = 0;
$rootScope.current_exercice = 0;
$rootScope.current_tag = undefined;
if ($scope.my) {
$rootScope.title = $scope.my.name;
$rootScope.authors = $scope.my.members.map(function (cur) {
@ -399,6 +403,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
.controller("RegisterController", function($scope, $rootScope, $location, $http) {
$rootScope.current_theme = 0;
$rootScope.current_exercice = 0;
$rootScope.current_tag = undefined;
$rootScope.title = "Bienvenue au challenge forensic !";
$rootScope.authors = null;
@ -469,6 +474,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
.controller("TagController", function($scope, $rootScope, $routeParams) {
$rootScope.current_theme = 0;
$rootScope.current_exercice = 0;
$rootScope.current_tag = $routeParams.tag;
$rootScope.title = "Challenges " + $routeParams.tag;
$rootScope.authors = "";
@ -488,6 +494,7 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
.controller("RankController", function($scope, $rootScope) {
$rootScope.current_theme = 0;
$rootScope.current_exercice = 0;
$rootScope.current_tag = undefined;
$rootScope.title = "Classement général";
$rootScope.authors = "";
@ -506,12 +513,14 @@ angular.module("FICApp", ["ngRoute", "ngSanitize"])
.controller("VideosController", function($scope, $rootScope) {
$rootScope.current_theme = 0;
$rootScope.current_exercice = 0;
$rootScope.current_tag = undefined;
$rootScope.title = "Vidéos de résolution";
$rootScope.authors = "";
})
.controller("HomeController", function($scope, $rootScope) {
$rootScope.current_theme = 0;
$rootScope.current_exercice = 0;
$rootScope.current_tag = undefined;
$rootScope.title = "Bienvenue au challenge forensic de l'ÉPITA !";
$rootScope.authors = "";
});