From 9296a6b934a914e4548793de8247c8175cb23dd1 Mon Sep 17 00:00:00 2001 From: devfake Date: Thu, 25 Jun 2015 15:18:44 +0200 Subject: [PATCH] display correct deck list --- .../deck-builder/components/deck-builder.js | 24 +++++++--- .../deck-builder/views/deck-builder.html | 45 +++++++++++++++---- site/client/assets/sass/_base.scss | 6 ++- site/client/assets/sass/_shame_cards.scss | 15 ------- 4 files changed, 60 insertions(+), 30 deletions(-) diff --git a/site/client/app/modules/deck-builder/components/deck-builder.js b/site/client/app/modules/deck-builder/components/deck-builder.js index 6f36998..cf0bd17 100644 --- a/site/client/app/modules/deck-builder/components/deck-builder.js +++ b/site/client/app/modules/deck-builder/components/deck-builder.js @@ -8,7 +8,7 @@ module.exports = { data: function() { return { cards: [], - deck: {}, + deck: [], leaders: [], leader: null, @@ -22,6 +22,18 @@ module.exports = { this.initDeck(); }, + filters: { + getType: function(c, type) { + var tmp = $.map(c, (item) => { + if(item.type == type) return item; + }); + + return tmp; + + return c; + } + }, + methods: { changeDeck: function(deck) { // todo: load animation @@ -45,11 +57,13 @@ module.exports = { }, initDeck: function() { - this.deck = {}; + this.deck = []; + var _deck = deck[this.factionFilter]; + + for(var item in _deck) { + this.deck.push(cards[_deck[item]]); + } - deck[this.factionFilter].forEach((x) => { - this.deck[x] = (this.deck[x] || 0) + 1; - }); }, // test diff --git a/site/client/app/modules/deck-builder/views/deck-builder.html b/site/client/app/modules/deck-builder/views/deck-builder.html index c32ce10..0888485 100644 --- a/site/client/app/modules/deck-builder/views/deck-builder.html +++ b/site/client/app/modules/deck-builder/views/deck-builder.html @@ -14,7 +14,7 @@
-
+
@@ -31,12 +31,14 @@
+
LEADER -
+
+
1x
-
+
@@ -46,9 +48,10 @@
CLOSE COMBAT -
+
+
{{ c > 1 ? c + 'x' : '' }}
-
+
@@ -57,9 +60,20 @@
RANGE -
+
-
+
+
+
+
+
+ +
+ SPECIAL + +
+
+
@@ -68,9 +82,9 @@
WEATHER -
+
-
+
@@ -83,6 +97,19 @@