Deleting decks reloads list of decks.

This commit is contained in:
marcins78@gmail.com
2011-12-14 14:08:08 +00:00
parent 58a1895c84
commit 4d7a95c68e
2 changed files with 12 additions and 8 deletions

View File

@@ -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"
});

View File

@@ -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 = $("<div></div>")
.dialog({
autoOpen: false,
closeOnEscape: true,
resizable: false,
title: "Card information"
});
autoOpen: false,
closeOnEscape: true,
resizable: false,
title: "Card information"
});
var swipeOptions = {
threshold: 20,