Deleting decks reloads list of decks.
This commit is contained in:
@@ -185,7 +185,7 @@ var GempLotrCommunication = Class.extend({
|
|||||||
dataType: "xml"
|
dataType: "xml"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deleteDeck: function(deckName) {
|
deleteDeck: function(deckName, callback) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: this.url + "/deck/delete",
|
url: this.url + "/deck/delete",
|
||||||
@@ -193,6 +193,7 @@ var GempLotrCommunication = Class.extend({
|
|||||||
data: {
|
data: {
|
||||||
participantId: getUrlParam("participantId"),
|
participantId: getUrlParam("participantId"),
|
||||||
deckName: deckName},
|
deckName: deckName},
|
||||||
|
success: callback,
|
||||||
error: this.failure,
|
error: this.failure,
|
||||||
dataType: "xml"
|
dataType: "xml"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -121,13 +121,16 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
function() {
|
function() {
|
||||||
if (confirm("Are you sure you want to delete this deck?")) {
|
if (confirm("Are you sure you want to delete this deck?")) {
|
||||||
if (that.deckName != null)
|
if (that.deckName != null)
|
||||||
that.comm.deleteDeck(that.deckName);
|
that.comm.deleteDeck(that.deckName,
|
||||||
|
function() {
|
||||||
|
that.loadDecks();
|
||||||
|
});
|
||||||
that.deckName = null;
|
that.deckName = null;
|
||||||
$("#editingDeck").html("Editing deck: New deck");
|
$("#editingDeck").html("Editing deck: New deck");
|
||||||
that.clearDeck();
|
that.clearDeck();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
loadDeckBut.click(
|
loadDeckBut.click(
|
||||||
function() {
|
function() {
|
||||||
@@ -410,11 +413,11 @@ var GempLotrDeckBuildingUI = Class.extend({
|
|||||||
|
|
||||||
this.infoDialog = $("<div></div>")
|
this.infoDialog = $("<div></div>")
|
||||||
.dialog({
|
.dialog({
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
closeOnEscape: true,
|
closeOnEscape: true,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
title: "Card information"
|
title: "Card information"
|
||||||
});
|
});
|
||||||
|
|
||||||
var swipeOptions = {
|
var swipeOptions = {
|
||||||
threshold: 20,
|
threshold: 20,
|
||||||
|
|||||||
Reference in New Issue
Block a user