settings: change param to enable/disable depends by the depth
This commit is contained in:
parent
5d432cdcfc
commit
4ee70a8781
6 changed files with 12 additions and 15 deletions
|
|
@ -425,6 +425,7 @@ angular.module("FICApp")
|
|||
.controller("SettingsController", function($scope, $rootScope, Settings, ROSettings, $location, $http, $interval) {
|
||||
$scope.config = Settings.get();
|
||||
$scope.config.$promise.then(function(response) {
|
||||
response.enableExerciceDepend = response.unlockedChallengeDepth >= 0;
|
||||
$rootScope.settings.start = new Date(response.start);
|
||||
$rootScope.settings.end = new Date(response.end);
|
||||
$rootScope.settings.generation = new Date(response.generation);
|
||||
|
|
@ -454,8 +455,11 @@ angular.module("FICApp")
|
|||
var nEnd = this.config.end;
|
||||
var nGen = this.config.generation;
|
||||
var aTime = this.config.activateTime;
|
||||
this.config.$update(function() {
|
||||
var state = this.config.enableExerciceDepend;
|
||||
this.config.unlockedChallengeDepth = (this.config.enableExerciceDepend?this.config.unlockedChallengeDepth:-1)
|
||||
this.config.$update(function(response) {
|
||||
$rootScope.newBox('success', msg);
|
||||
response.enableExerciceDepend = response.unlockedChallengeDepth >= 0;
|
||||
$rootScope.settings.start = new Date(nStart);
|
||||
$rootScope.settings.end = new Date(nEnd);
|
||||
$rootScope.settings.generation = new Date(nGen);
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@
|
|||
<label class="custom-control custom-checkbox">
|
||||
<input class="custom-control-input" type="checkbox" ng-model="config.enableExerciceDepend">
|
||||
<span class="custom-control-label">Activer les dépendances des exercices</span>
|
||||
<input type="text" class="form-control form-control-sm" id="duration" ng-model="config.unlockedChallengeDepth" ng-disabled="!config.enableExerciceDepend" integer>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Reference in a new issue