From dc37dd2c609d901a545d561b9de40c3510a48e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 22 Dec 2017 12:37:57 +0100 Subject: [PATCH] Use separate object when editing card descriptions (fixes #369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- js/controller/CardController.js | 5 +++-- templates/part.card.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/controller/CardController.js b/js/controller/CardController.js index f4815f517..4556b5b08 100644 --- a/js/controller/CardController.js +++ b/js/controller/CardController.js @@ -58,6 +58,7 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo return false; } $scope.status.cardEditDescription = true; + $scope.status.edit = angular.copy(CardService.getCurrent()); return true; }; $scope.cardEditDescriptionChanged = function ($event) { @@ -73,7 +74,7 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo $scope.status.lastSave = currentTime; var header = $('.section-header.card-description'); header.find('.save-indicator.unsaved').fadeIn(500); - CardService.update(CardService.getCurrent()).then(function (data) { + CardService.update($scope.status.edit).then(function (data) { var header = $('.section-header.card-description'); header.find('.save-indicator.unsaved').hide(); header.find('.save-indicator.saved').fadeIn(250).fadeOut(1000); @@ -89,7 +90,7 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo }); }; $scope.cardUpdate = function (card) { - CardService.update(CardService.getCurrent()).then(function (data) { + CardService.update(card).then(function (data) { $scope.status.cardEditDescription = false; var header = $('.section-content.card-description'); header.find('.save-indicator.unsaved').hide(); diff --git a/templates/part.card.php b/templates/part.card.php index 9931c1248..eaf9258be 100644 --- a/templates/part.card.php +++ b/templates/part.card.php @@ -98,8 +98,8 @@