Fix some variants and improve a few other things a little bit
[vchess.git] / client / src / components / ContactForm.vue
index 9c70a55..f9c5c60 100644 (file)
@@ -1,18 +1,23 @@
 <template lang="pug">
 div
-  input#modalContact.modal(type="checkbox" @change="trySetEnterTime($event)")
-  div(role="dialog" data-checkbox="modalContact")
+  input#modalContact.modal(
+    type="checkbox"
+    @change="trySetEnterTime($event)"
+  )
+  div(
+    role="dialog"
+    data-checkbox="modalContact"
+  )
     .card
       label.modal-close(for="modalContact")
-      form(@submit.prevent="trySendMessage()" @keyup.enter="trySendMessage()")
-        fieldset
-          label(for="userEmail") {{ st.tr["Email"] }}
-          input#userEmail(type="email")
-        fieldset
-          label(for="mailSubject") {{ st.tr["Subject"] }}
-          input#mailSubject(type="text")
-        fieldset
-          textarea#mailContent(:placeholder="st.tr['Your message']")
+      fieldset
+        label(for="userEmail") {{ st.tr["Email"] }}
+        input#userEmail(type="email" :value="st.user.email")
+      fieldset
+        label(for="mailSubject") {{ st.tr["Subject"] }}
+        input#mailSubject(type="text")
+      fieldset
+        textarea#mailContent(:placeholder="st.tr['Your message']")
       button(@click="trySendMessage()") {{ st.tr["Send"] }}
       #dialog.text-center {{ st.tr[infoMsg] }}
 </template>
@@ -56,7 +61,6 @@ export default {
         !confirm(this.st.tr["No subject. Send anyway?"])
       )
         return;
-
       // Message sending:
       ajax(
         "/messages",
@@ -81,9 +85,11 @@ export default {
 [type="checkbox"].modal+div .card
   max-width: 767px
   max-height: 100%
+
 textarea#mailContent
   width: 100%
   min-height: 100px
+
 #dialog
   padding: 5px
   color: blue