Discussion Forum

[Fixed] Sideboard card quantity

When I change the number of cards on my sideboard the total number of cards on sideboard is updated on the main decks header instead of sideboards header.

This seems to be a javascript bug which I tracked to /js/vault.edit-deck.js
in function UpdateCardQuantity. Here's a snippet of the faulty part.

Note the last instruction. The update is always made to #count, never to #sideboard-count


else {
//location.reload();
$('#' + deckGroupChar + response.d.id).text(response.d.quantity);
//take away the current quantity
var cardCount
if (deckGroupId == 0) {
cardCount = parseInt($('#count').text(), 10) - originalVal;
}
else {
cardCount = parseInt($('#sideboard-count').text(), 10) - originalVal;
}
//add on the new quant
$('#count').text(cardCount + response.d.quantity);
}


Here's my suggested fix.


else {
//location.reload();
$('#' + deckGroupChar + response.d.id).text(response.d.quantity);
//take away the current quantity
var cardCount
if (deckGroupId == 0) {
cardCount = parseInt($('#count').text(), 10) - originalVal;
$('#count').text(cardCount + response.d.quantity);
}
else {
cardCount = parseInt($('#sideboard-count').text(), 10) - originalVal;
$('#sideboard-count').text(cardCount + response.d.quantity);
}
}
Posted 09 January 2013 at 12:32

Permalink

Brilliant thanks. Fixed :)
0
Posted 09 January 2013 at 21:20

Permalink