Cards: Fix not saved card deletion.
This commit is contained in:
@@ -196,7 +196,9 @@ var Card = function (cfg, idCard, title, body, x, y) {
|
|||||||
this.Editing = false;
|
this.Editing = false;
|
||||||
|
|
||||||
// Selfinsert
|
// Selfinsert
|
||||||
this.cfg.Cards.push(this);
|
if (this.IDCard > 0) {
|
||||||
|
this.cfg.Cards.push(this);
|
||||||
|
}
|
||||||
this.InsertInContainer(this.cfg.divBoard);
|
this.InsertInContainer(this.cfg.divBoard);
|
||||||
};
|
};
|
||||||
Card.prototype = {
|
Card.prototype = {
|
||||||
@@ -374,7 +376,9 @@ Card.prototype = {
|
|||||||
var recvData = JSON.parse(responseText);
|
var recvData = JSON.parse(responseText);
|
||||||
if (recvData && recvData instanceof Object && recvData.IsOK == true) {
|
if (recvData && recvData instanceof Object && recvData.IsOK == true) {
|
||||||
card.RemoveFromContainer();
|
card.RemoveFromContainer();
|
||||||
card.cfg.RemoveCardByID(card.IDCard);
|
if (card.IDCard > 0) {
|
||||||
|
card.cfg.RemoveCardByID(card.IDCard);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
card.Show();
|
card.Show();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user