From 2360296dae3fd8cd76f5cc2b1254c17c394a8353 Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Thu, 2 Jul 2015 10:38:10 +0200 Subject: [PATCH] Cards: Fix not saved card deletion. --- VAR.Focus.Web/Scripts/05. Cards.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/VAR.Focus.Web/Scripts/05. Cards.js b/VAR.Focus.Web/Scripts/05. Cards.js index 31a07e5..ca8653b 100644 --- a/VAR.Focus.Web/Scripts/05. Cards.js +++ b/VAR.Focus.Web/Scripts/05. Cards.js @@ -196,7 +196,9 @@ var Card = function (cfg, idCard, title, body, x, y) { this.Editing = false; // Selfinsert - this.cfg.Cards.push(this); + if (this.IDCard > 0) { + this.cfg.Cards.push(this); + } this.InsertInContainer(this.cfg.divBoard); }; Card.prototype = { @@ -374,7 +376,9 @@ Card.prototype = { var recvData = JSON.parse(responseText); if (recvData && recvData instanceof Object && recvData.IsOK == true) { card.RemoveFromContainer(); - card.cfg.RemoveCardByID(card.IDCard); + if (card.IDCard > 0) { + card.cfg.RemoveCardByID(card.IDCard); + } } else { card.Show(); }