Some fixes
[vchess.git] / client / src / views / Game.vue
index e77492f..7d4369b 100644 (file)
@@ -1,6 +1,6 @@
 <template lang="pug">
 main
-  input#modalChat.modal(type="checkbox" @change="toggleChat")
+  input#modalChat.modal(type="checkbox" @click="resetChatColor")
   div#chatWrap(role="dialog" data-checkbox="modalChat"
       aria-labelledby="inputChat")
     #chat.card
@@ -227,7 +227,7 @@ export default {
           {
             // Minimal game informations:
             id: this.game.id,
-            players: this.game.players.map(p => { return {name:p.name}; }),
+            players: this.game.players,
             vid: this.game.vid,
             timeControl: this.game.timeControl,
           };
@@ -555,12 +555,9 @@ export default {
       if (this.repeat[repIdx] >= 3)
         this.drawOffer = "threerep";
     },
-    toggleChat: function() {
-      let modalChat = document.getElementById("modalChat");
-      modalChat.style.backgroundColor =
-        (modalChat.style.backgroundColor == "#e2e2e2"
-          ? "#c5fefe"
-          : "#e2e2e2");
+    resetChatColor: function() {
+      // TODO: this is called twice, once on opening an once on closing
+      document.getElementById("chatBtn").style.backgroundColor = "#e2e2e2";
     },
     finishSendChat: function(chat) {
       // NOTE: anonymous chats in corr games are not stored on server (TODO?)
@@ -616,6 +613,9 @@ export default {
 @media screen and (max-width: 767px)
   #aboveBoard
     text-align: center
+@media screen and (min-width: 768px)
+  #aboveBoard
+    margin-left: 30%
 
 .name
   font-size: 1.5rem