Use separate object when editing card descriptions (fixes #369)

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-12-22 12:37:57 +01:00
parent 5d38f6a176
commit dc37dd2c60
2 changed files with 5 additions and 4 deletions

View File

@@ -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();