change UI after label has been changed
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
committed by
Julius Härtl
parent
4961c109a2
commit
b4353ce102
@@ -323,7 +323,18 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
||||
// remove from board data
|
||||
var i = BoardService.getCurrent().labels.indexOf(label);
|
||||
BoardService.getCurrent().labels.splice(i, 1);
|
||||
// TODO: remove from cards
|
||||
|
||||
// remove from cards
|
||||
var cards = CardService.data;
|
||||
for (var card in cards) {
|
||||
var labelsFromCard = cards[card].labels;
|
||||
|
||||
labelsFromCard.forEach(function (labelFromCard, index) {
|
||||
if (labelFromCard.id === label.id) {
|
||||
cards[card].labels.splice(index, 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.labelCreate = function (label) {
|
||||
@@ -338,6 +349,18 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
||||
$scope.labelUpdate = function (label) {
|
||||
label.edit = false;
|
||||
LabelService.update(label);
|
||||
|
||||
// update labels in UI
|
||||
var cards = CardService.data;
|
||||
for (var card in cards) {
|
||||
var labelsFromCard = cards[card].labels;
|
||||
|
||||
labelsFromCard.forEach(function (labelFromCard, index) {
|
||||
if (labelFromCard.id === label.id) {
|
||||
cards[card].labels[index] = label;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$scope.aclAdd = function (sharee) {
|
||||
|
||||
Reference in New Issue
Block a user