Use separate object when editing card descriptions (fixes #369)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -98,8 +98,8 @@
|
||||
<div class="section-content card-description">
|
||||
<textarea elastic ng-if="status.cardEditDescription"
|
||||
placeholder="<?php p($l->t('Add a card description…')); ?>"
|
||||
ng-blur="cardUpdate(cardservice.getCurrent())"
|
||||
ng-model="cardservice.getCurrent().description"
|
||||
ng-blur="cardUpdate(status.edit)"
|
||||
ng-model="status.edit.description"
|
||||
ng-change="cardEditDescriptionChanged()"
|
||||
autofocus-on-insert> </textarea>
|
||||
<div class="container" ng-click="cardEditDescriptionShow($event)"
|
||||
|
||||
Reference in New Issue
Block a user