Fixed an issue with editing the scheduled days on an existing backup.
This fixes #2324
This commit is contained in:
@@ -147,10 +147,7 @@ backupApp.controller('EditBackupController', function ($scope, $routeParams, $lo
|
||||
}
|
||||
};
|
||||
|
||||
$scope.toggleArraySelection = function (lst, value) {
|
||||
if (lst === null)
|
||||
lst = [];
|
||||
|
||||
function toggleArraySelection(lst, value) {
|
||||
var ix = lst.indexOf(value);
|
||||
|
||||
if (ix > -1)
|
||||
@@ -159,6 +156,18 @@ backupApp.controller('EditBackupController', function ($scope, $routeParams, $lo
|
||||
lst.push(value);
|
||||
};
|
||||
|
||||
$scope.toggleAllowedDays = function(value) {
|
||||
if ($scope.Schedule.AllowedDays == null)
|
||||
$scope.Schedule.AllowedDays = [];
|
||||
toggleArraySelection($scope.Schedule.AllowedDays, value);
|
||||
};
|
||||
|
||||
$scope.toggleExcludeAttributes = function(value) {
|
||||
if ($scope.ExcludeAttributes == null)
|
||||
$scope.ExcludeAttributes = [];
|
||||
toggleArraySelection($scope.ExcludeAttributes, value);
|
||||
};
|
||||
|
||||
$scope.save = function() {
|
||||
|
||||
if (!EditBackupService.preValidate($scope))
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
name="fileattr_{{attr.value}}"
|
||||
value="{{attr.value}}"
|
||||
ng-checked="ExcludeAttributes.indexOf(attr.value) > -1"
|
||||
ng-click="toggleArraySelection(ExcludeAttributes, attr.value)"
|
||||
ng-click="toggleExcludeAttributes(attr.value)"
|
||||
/>
|
||||
<label for="fileattr_{{attr.value}}">{{attr.name}}</label>
|
||||
</div>
|
||||
@@ -275,7 +275,7 @@
|
||||
name="dayofweek_{{day.value}}"
|
||||
value="{{day.value}}"
|
||||
ng-checked="Schedule.AllowedDays.indexOf(day.value) > -1"
|
||||
ng-click="toggleArraySelection(Schedule.AllowedDays, day.value)"
|
||||
ng-click="toggleAllowedDays(day.value)"
|
||||
/>
|
||||
<label for="dayofweek_{{day.value}}">{{day.name}}</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user