From 4d7a95c68e90bd9eea5e201f4eee5ac1a9eae187 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Wed, 14 Dec 2011 14:08:08 +0000 Subject: [PATCH] Deleting decks reloads list of decks. --- .../src/main/webapp/js/communication.js | 3 ++- .../src/main/webapp/js/deckBuildingUi.js | 17 ++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/communication.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/communication.js index d0f314eff..9d86506af 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/communication.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/communication.js @@ -185,7 +185,7 @@ var GempLotrCommunication = Class.extend({ dataType: "xml" }); }, - deleteDeck: function(deckName) { + deleteDeck: function(deckName, callback) { $.ajax({ type: "POST", url: this.url + "/deck/delete", @@ -193,6 +193,7 @@ var GempLotrCommunication = Class.extend({ data: { participantId: getUrlParam("participantId"), deckName: deckName}, + success: callback, error: this.failure, dataType: "xml" }); diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js index 77645864a..9eceb6491 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js @@ -121,13 +121,16 @@ var GempLotrDeckBuildingUI = Class.extend({ function() { if (confirm("Are you sure you want to delete this deck?")) { if (that.deckName != null) - that.comm.deleteDeck(that.deckName); + that.comm.deleteDeck(that.deckName, + function() { + that.loadDecks(); + }); that.deckName = null; $("#editingDeck").html("Editing deck: New deck"); that.clearDeck(); } } - ); + ); loadDeckBut.click( function() { @@ -410,11 +413,11 @@ var GempLotrDeckBuildingUI = Class.extend({ this.infoDialog = $("
") .dialog({ - autoOpen: false, - closeOnEscape: true, - resizable: false, - title: "Card information" - }); + autoOpen: false, + closeOnEscape: true, + resizable: false, + title: "Card information" + }); var swipeOptions = { threshold: 20,