@@ -327,13 +327,15 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
|||||||
// remove from cards
|
// remove from cards
|
||||||
var cards = CardService.data;
|
var cards = CardService.data;
|
||||||
for (var card in cards) {
|
for (var card in cards) {
|
||||||
var labelsFromCard = cards[card].labels;
|
if (Object.prototype.hasOwnProperty.call(cards, card)) {
|
||||||
|
var labelsFromCard = cards[card].labels;
|
||||||
|
|
||||||
labelsFromCard.forEach(function (labelFromCard, index) {
|
labelsFromCard.forEach(function (labelFromCard, index) {
|
||||||
if (labelFromCard.id === label.id) {
|
if (labelFromCard.id === label.id) {
|
||||||
cards[card].labels.splice(index, 1);
|
cards[card].labels.splice(index, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -353,13 +355,15 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
|
|||||||
// update labels in UI
|
// update labels in UI
|
||||||
var cards = CardService.data;
|
var cards = CardService.data;
|
||||||
for (var card in cards) {
|
for (var card in cards) {
|
||||||
var labelsFromCard = cards[card].labels;
|
if (Object.prototype.hasOwnProperty.call(cards, card)) {
|
||||||
|
var labelsFromCard = cards[card].labels;
|
||||||
|
|
||||||
labelsFromCard.forEach(function (labelFromCard, index) {
|
labelsFromCard.forEach(function (labelFromCard, index) {
|
||||||
if (labelFromCard.id === label.id) {
|
if (labelFromCard.id === label.id) {
|
||||||
cards[card].labels[index] = label;
|
cards[card].labels[index] = label;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user