Skip to content

Commit f589d32

Browse files
committed
fix Flavor popover in DeckBuilder
1 parent 926688f commit f589d32

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

src/components/DeckBuilder.vue

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
<!-- Deck manipulation & `Start game` | `Back to lobby` controls -->
1313
<form>
14-
<!-- TODO: {Phrancis} Lay this out in a nice Bootstrap form. -->
1514
<label>Save deck as:</label>
1615
<input v-model="deckName" type="text" />
1716
<input @click="saveDeck()" type="button" value="Save Deck" class="btn btn-xs btn-primary"/>
@@ -21,36 +20,18 @@
2120
<input v-if="enteringGame" @click="goBack()" type="button" value="Go back to lobby" class="btn btn-sm btn-default"/>
2221
</form>
2322

24-
<!-- List of saved decks, with `Delete` button -->
23+
<!-- List of saved decks, with a Delete button for each -->
2524
<ul>
2625
<li v-for="deck in savedDecks">
2726
<span class="load-deck" @click="switchDeck(deck)">{{deck.name}}</span>
28-
<input @click="deleteDeck(deck.name)" type="button" value="Delete" class="btn btn-xs btn-danger"/>
27+
<input @click="deleteDeck(deck.name)" type="button" value="Delete" class="btn btn-sm btn-danger"/>
2928
</li>
3029
</ul>
3130

3231
<ul>
3332
<CardModel :card="cardInfo" v-if="cardInfo"></CardModel>
3433
</ul>
3534

36-
<!-- LIST OF ALL CARDS - Displays one full row below for every card -->
37-
<!-- Available {{card.properties}} values
38-
SERVER JSON name | AngularJS ref name | Note
39-
-------------------------------------------------
40-
"SICKNESS" | SICKNESS | 1 or 0, or empty (for cards where n/a)
41-
"MANA_COST" | MANA_COST | n, or empty (for cards n/a)
42-
"MANA_UPKEEP" | MANA_UPKEEP | n, or empty (for card n/a)
43-
"ATTACK" | ATTACK | n, or empty (for cards n/a)
44-
"HEALTH" | HEALTH | n, or empty (for cards n/a)
45-
"ATTACK_AVAILABLE" | ATTACK_AVAILABLE | 1, or empty (when explicit 0 n/a)
46-
"flavor" | flavor | flavor, or empty
47-
"name" | name | name (cannot be empty)
48-
"description" | effect | effect, or empty
49-
"type" | creatureType | type, or empty (for non-creatures)
50-
"MAX_HEALTH" | MAX_HEALTH | n, or empty (for cards n/a)
51-
"SCRAP" | SCRAP | n, or empty (for cards n/a)
52-
"SCRAP_COST" | SCRAP_COST | n, or empty (for cards n/a)
53-
-->
5435
<table class="deckbuilder-card-table">
5536
<tr>
5637
<th>Type</th>
@@ -68,12 +49,16 @@
6849
<td>{{card.properties.creatureType}}</td>
6950
<td><a href @click.prevent="showDetails(card)">{{card.properties.name}}</a></td>
7051
<td style="text-align: center;">
71-
<!-- Controls to add or remove a card to deck, and counter to show "current / max" count -->
52+
<!-- Controls to add or remove a card to deck, and counter to show "current / max" count -->
7253
<div class="btn-group">
7354
<!-- MINUS button -->
7455
<button @click="decrement(card)" type="button" class="btn btn-xs btn-default fa fa-minus"></button>
75-
<!-- How many cards you selected for this deck, and what the max allowed is -->
76-
<button type="button" class="btn btn-xs btn-default"><b :data-count="currentDeck[card.properties.id]">{{currentDeck[card.properties.id] || 0}} / {{card.max}}</b></button>
56+
<!-- How many of each card you selected for this deck, and what the max allowed is -->
57+
<button type="button" class="btn btn-xs btn-default">
58+
<span :data-count="currentDeck[card.properties.id]">
59+
{{currentDeck[card.properties.id] || 0}} / {{card.max}}
60+
</span>
61+
</button>
7762
<!-- PLUS button -->
7863
<button @click="increment(card)" type="button" class="btn btn-xs btn-default fa fa-plus"></button>
7964
</div>
@@ -101,10 +86,15 @@
10186
<td style="text-align: center;">
10287
{{card.properties.effect}}
10388
</td>
104-
<td style="text-align: center;"><!-- flavor tooltip -->
105-
<b-btn type="button" class="btn btn-xs btn-default" popover-placement="right"
106-
v-b-popover.hover="card.properties.flavor"
107-
v-if="card.properties.flavor">?</b-btn>
89+
<td style="text-align: center;">
90+
<!-- flavor tooltip -->
91+
<b-btn v-if="card.properties.flavor" class="btn btn-dark fa fa-book" :id="`${card.id}-flavor`"></b-btn>
92+
<b-popover :target="`${card.id}-flavor`"
93+
:title="card.properties.name"
94+
triggers="hover focus"
95+
:content="card.properties.flavor"
96+
placement="right">
97+
</b-popover>
10898
</td>
10999
</tr>
110100
</table>
@@ -264,6 +254,7 @@ export default {
264254
switchDeck(deck) {
265255
this.currentDeckName = deck.name;
266256
this.currentDeck = deck.cards;
257+
this.deckName = deck.name;
267258
},
268259
269260
/**

0 commit comments

Comments
 (0)