(js) Don't block when copying/moving vLists
This commit is contained in:
parent
907024d2c4
commit
829c8fee68
|
@ -312,25 +312,25 @@
|
|||
* @see AddressBookController._selectedCardsOperation
|
||||
*/
|
||||
function dragSelectedCards(srcFolder, dstFolder, mode) {
|
||||
var dstId, cards, ids, clearCardView, promise, success;
|
||||
var dstId, allCards, cards, ids, clearCardView, promise, success;
|
||||
|
||||
dstId = dstFolder.id;
|
||||
clearCardView = false;
|
||||
cards = srcFolder.$selectedCards();
|
||||
if (cards.length === 0)
|
||||
cards = [srcFolder.$selectedCard()];
|
||||
allCards = srcFolder.$selectedCards();
|
||||
if (allCards.length === 0)
|
||||
allCards = [srcFolder.$selectedCard()];
|
||||
cards = _.filter(allCards, function(card) {
|
||||
return card.$isCard();
|
||||
});
|
||||
|
||||
if (_.find(cards, function(card) {
|
||||
return card.$isList();
|
||||
})) {
|
||||
if (cards.length != allCards.length)
|
||||
$mdToast.show(
|
||||
$mdToast.simple()
|
||||
.content(l("Lists can't be moved or copied."))
|
||||
.position('top right')
|
||||
.hideDelay(2000));
|
||||
return;
|
||||
}
|
||||
|
||||
if (cards.length) {
|
||||
if (mode == 'copy') {
|
||||
promise = srcFolder.$copyCards(cards, dstId);
|
||||
success = l('%{0} card(s) copied', cards.length);
|
||||
|
@ -354,6 +354,7 @@
|
|||
.hideDelay(2000));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue