From 51b4d4e8d1bc1df8d9c1f11647ec0ed09a9746e5 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sun, 26 Feb 2017 23:39:16 +0100 Subject: [PATCH] Fixed an issue with editing the scheduled days on an existing backup. This fixes #2324 --- .../scripts/controllers/EditBackupController.js | 17 +++++++++++++---- .../webroot/ngax/templates/addoredit.html | 4 ++-- 2 files changed, 15 insertions(+), 6 deletions(-) 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)" />