Attempt to fix selected piece over smartphone menu
[vchess.git] / client / src / views / Game.vue
index 1b82d81..51fde64 100644 (file)
@@ -14,7 +14,8 @@ main
         :newChat="newChat" @mychat="processChat")
   .row
     #aboveBoard.col-sm-12.col-md-9.col-md-offset-3.col-lg-10.col-lg-offset-2
-      span.variant-info {{ game.vname }}
+      span.variant-cadence {{ game.cadence }}
+      span.variant-name {{ game.vname }}
       button#chatBtn(onClick="doClick('modalChat')") Chat
       #actions(v-if="game.score=='*'")
         button(@click="clickDraw()" :class="{['draw-' + drawOffer]: true}")
@@ -343,13 +344,10 @@ export default {
           this.drawOffer = "received";
           break;
         case "newchat":
-        {
-          const chat = data.data;
-          this.newChat = chat;
+          this.newChat = data.data;
           if (!document.getElementById("modalChat").checked)
-            document.getElementById("chatBtn").style.backgroundColor = "#c5fefe";
+            document.getElementById("chatBtn").classList.add("somethingnew");
           break;
-        }
       }
     },
     socketCloseListener: function() {
@@ -563,7 +561,10 @@ export default {
     processMove: function(move) {
       if (this.game.type == "corr" && move.color == this.game.mycolor)
       {
-        if (!confirm(this.st.tr["Are you sure?"]))
+
+//TODO: if takeback, then time over occurs.
+
+        if (!confirm(this.st.tr["Move played:"] + " " + move.notation + "\n" + this.st.tr["Are you sure?"]))
           return this.$set(this.game, "moveToUndo", move);
       }
       // Update storage (corr or live) if I play in the game
@@ -670,7 +671,7 @@ export default {
     },
     resetChatColor: function() {
       // TODO: this is called twice, once on opening an once on closing
-      document.getElementById("chatBtn").style.backgroundColor = "#e2e2e2";
+      document.getElementById("chatBtn").classList.remove("somethingnew");
     },
     processChat: function(chat) {
       this.send("newchat", {data:chat});
@@ -709,6 +710,9 @@ export default {
   color: grey
   font-style: italic
 
+#playersInfo > p
+  margin: 0
+
 @media screen and (min-width: 768px)
   #actions
     width: 300px
@@ -718,7 +722,7 @@ export default {
 
 #actions
   display: inline-block
-  margin-top: 10px
+  margin: 0
   button
     display: inline-block
     margin: 0
@@ -730,7 +734,10 @@ export default {
   #aboveBoard
     margin-left: 30%
 
-.variant-info
+.variant-cadence
+  padding-right: 10px
+
+.variant-name
   font-weight: bold
   padding-right: 10px
 
@@ -763,4 +770,7 @@ export default {
 
 .draw-threerep, .draw-threerep:hover
   background-color: #e4d1fc
+
+.somethingnew
+  background-color: #c5fefe
 </style>