diff --git a/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js b/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js
index be7001df8..0a09162e0 100644
--- a/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js
+++ b/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js
@@ -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))
diff --git a/Duplicati/Server/webroot/ngax/templates/addoredit.html b/Duplicati/Server/webroot/ngax/templates/addoredit.html
index 18a09bc48..3dc69cd5b 100755
--- a/Duplicati/Server/webroot/ngax/templates/addoredit.html
+++ b/Duplicati/Server/webroot/ngax/templates/addoredit.html
@@ -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)"
/>
@@ -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)"
/>