Skip to content

Commit 4908a5e

Browse files
committed
Use card.properties.id instead of card.id for String value and not int
1 parent 6750610 commit 4908a5e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/deck_builder/controller.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function DeckbuilderController(CardshifterServerAPI, $scope, $rootScope, $locati
6868
for(var card in deck.cardData) {
6969
if(deck.cardData.hasOwnProperty(card)) {
7070
deck.cardData[card].max = deck.max[card] || deck.maxPerCard;
71-
$scope.currentDeck[deck.cardData[card].id] = 0;
71+
$scope.currentDeck[deck.cardData[card].properties.id] = 0;
7272
}
7373
}
7474

@@ -91,8 +91,8 @@ function DeckbuilderController(CardshifterServerAPI, $scope, $rootScope, $locati
9191
* @param card:Object -- The card to decrement
9292
*/
9393
$scope.decrement = function(card) {
94-
if($scope.currentDeck[card.id] !== 0) {
95-
$scope.currentDeck[card.id]--;
94+
if($scope.currentDeck[card.properties.id] !== 0) {
95+
$scope.currentDeck[card.properties.id]--;
9696
}
9797
};
9898
/**
@@ -109,8 +109,8 @@ function DeckbuilderController(CardshifterServerAPI, $scope, $rootScope, $locati
109109
*/
110110
$scope.increment = function(card) {
111111
if($scope.getTotalSelected() !== $scope.maxCards &&
112-
$scope.currentDeck[card.id] !== card.max) {
113-
$scope.currentDeck[card.id]++;
112+
$scope.currentDeck[card.properties.id] !== card.max) {
113+
$scope.currentDeck[card.properties.id]++;
114114
}
115115
};
116116

src/deck_builder/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ <h2>{{getTotalSelected()}} / {{maxCards}}</h2>
6868
<!-- MINUS button -->
6969
<button data-ng-click="decrement(card)" type="button" class="btn btn-xs btn-default glyphicon glyphicon-minus"></button>
7070
<!-- How many cards you selected for this deck, and what the max allowed is -->
71-
<button type="button" class="btn btn-xs btn-default"><b>{{$parent.currentDeck[card.id] || 0}} / {{card.max}}</b></button>
71+
<button type="button" class="btn btn-xs btn-default"><b>{{$parent.currentDeck[card.properties.id] || 0}} / {{card.max}}</b></button>
7272
<!-- PLUS button -->
7373
<button data-ng-click="increment(card)" type="button" class="btn btn-xs btn-default glyphicon glyphicon-plus"></button>
7474
</div>

0 commit comments

Comments
 (0)