Deleting decks reloads list of decks.
This commit is contained in:
@@ -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"
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user