Improve display
authorBenjamin Auder <benjamin.auder@somewhere>
Mon, 30 Mar 2020 13:46:15 +0000 (15:46 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Mon, 30 Mar 2020 13:46:15 +0000 (15:46 +0200)
client/src/components/UploadGame.vue
client/src/views/MyGames.vue

index 269cc04..369333c 100644 (file)
@@ -37,6 +37,10 @@ export default {
 input#upload
   display: none
 
+button#uploadBtn
+  display: block
+  margin: 0 auto
+
 img.inline
   height: 22px
   @media screen and (max-width: 767px)
index 4eeb986..890d939 100644 (file)
@@ -23,6 +23,10 @@ main
         @show-game="showGame"
         @abortgame="abortGame"
       )
+      UploadGame(
+        v-show="display=='import'"
+        @game-uploaded="addGameImport"
+      )
       GameList(
         v-show="display=='import'"
         ref="importgames"
@@ -34,7 +38,6 @@ main
         @click="loadMore(display)"
       )
         | {{ st.tr["Load more"] }}
-      UploadGame(@game-uploaded="addGameImport")
 </template>
 
 <script>
@@ -175,9 +178,10 @@ export default {
       let elt = e ? e.target : document.getElementById(type + "Games");
       elt.classList.add("active");
       elt.classList.remove("somethingnew"); //in case of
-      if (elt.previousElementSibling)
-        elt.previousElementSibling.classList.remove("active");
-      else elt.nextElementSibling.classList.remove("active");
+      for (let t of ["live","corr","import"]) {
+        if (t != type)
+          document.getElementById(t + "Games").classList.remove("active");
+      }
     },
     addGameImport(game) {
       if (!game.id) {
@@ -188,8 +192,8 @@ export default {
     },
     tryShowNewsIndicator: function(type) {
       if (
-        (type == "live" && this.display == "corr") ||
-        (type == "corr" && this.display == "live")
+        (type == "live" && this.display != "live") ||
+        (type == "corr" && this.display != "corr")
       ) {
         document
           .getElementById(type + "Games")