Fix issues with preset challenges
[vchess.git] / client / src / views / Hall.vue
index 14ea54f..32d5963 100644 (file)
@@ -66,13 +66,20 @@ main
             option(value="1") {{ st.tr["Symmetric random"] }}
             option(value="2") {{ st.tr["Asymmetric random"] }}
         fieldset
-          label(for="memorizeChall") {{ st.tr["Memorize?"] }}
+          label(for="memorizeChall") {{ st.tr["Memorize"] }}
           input#memorizeChall(
             type="checkbox"
             v-model="newchallenge.memorize"
           )
         fieldset(v-if="st.user.id > 0")
-          label(for="selectPlayers") {{ st.tr["Play with?"] }}
+          label(for="selectPlayers") {{ st.tr["Play with"] }}
+          select#selectPlayersInList(v-model="newchallenge.to")
+            option(value="")
+            option(
+              v-for="p in Object.values(people)"
+              :value="p.name"
+            )
+              | {{ p.name }}
           input#selectPlayers(
             type="text"
             v-model="newchallenge.to"
@@ -374,8 +381,8 @@ export default {
   mounted: function() {
     document.addEventListener('visibilitychange', this.visibilityChange);
     ["peopleWrap", "infoDiv", "newgameDiv"].forEach(eltName => {
-      let elt = document.getElementById(eltName);
-      elt.addEventListener("click", processModalClick);
+      document.getElementById(eltName)
+        .addEventListener("click", processModalClick);
     });
     document.querySelectorAll("#predefinedCadences > button").forEach(b => {
       b.addEventListener("click", () => {
@@ -838,8 +845,7 @@ export default {
       const vModule = await import("@/variants/" + vname + ".js");
       this.newchallenge.V = vModule.VariantRules;
       this.newchallenge.vname = vname;
-      if (!!cb)
-        cb();
+      if (!!cb) cb();
     },
     trySetNewchallDiag: function() {
       if (!this.newchallenge.fen) {
@@ -865,7 +871,7 @@ export default {
       this.newchallenge.vid = pchall.vid;
       this.newchallenge.cadence = pchall.cadence;
       this.newchallenge.randomness = pchall.randomness;
-      this.issueNewChallenge();
+      this.loadNewchallVariant(this.issueNewChallenge);
     },
     issueNewChallenge: async function() {
       if (!!(this.newchallenge.cadence.match(/^[0-9]+$/)))
@@ -1265,6 +1271,10 @@ tr > td
   &.random-2
     background-color: #33B42B
 
+@media screen and (max-width: 767px)
+  h4
+    margin: 5px 0
+
 td.remove-preset
   background-color: lightgrey
   text-align: center