change placeholder, sort current deck

This commit is contained in:
AlecM33
2022-03-30 21:58:19 -04:00
parent ecb9c70ec1
commit 2709a22cb3
2 changed files with 8 additions and 2 deletions

View File

@@ -728,7 +728,13 @@ function updateDeckStatus (deckManager) {
if (document.getElementById('deck-list-placeholder')) {
document.getElementById('deck-list-placeholder').remove();
}
for (const card of deckManager.getCurrentDeck()) {
const sortedDeck = deckManager.getCurrentDeck().sort((a, b) => {
if (a.team !== b.team) {
return a.team === globals.ALIGNMENT.GOOD ? 1 : -1;
}
return a.role.localeCompare(b.role);
});
for (const card of sortedDeck) {
if (card.quantity > 0) {
const roleEl = document.createElement('div');
roleEl.classList.add('deck-role');

View File

@@ -35,7 +35,7 @@
<form id="join-form">
<div>
<label for="room-code">Room Code</label>
<input id="room-code" type="text" placeholder="six-character code..." autocomplete="off" required/>
<input id="room-code" type="text" placeholder="four-character code..." autocomplete="off" required/>
</div>
<input id="join-button" type="submit" value="Join"/>
</form>