]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/commitdiff
Use button element instead of input
authorMichal Sojka <michal.sojka@cvut.cz>
Wed, 15 Aug 2018 10:14:06 +0000 (12:14 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Wed, 15 Aug 2018 10:14:06 +0000 (12:14 +0200)
It seems that the web browser on the terminal does not understand '\n' in
value attribute so I hope that it will understand '<br>' in button's
content.

templates/main.js
templates/user.html

index 63aa40dcad4dd513d2afa3f4bbcd5572360e174a..464daccdbbce5a091ce4f857cc19253ec8dc9f66 100644 (file)
@@ -59,7 +59,7 @@ function updateUI()
         }
 
         if (timeToLogout !== undefined)
-            document.getElementById("logout_button").value = '\nlogout\n(' + timeToLogout + ' s)';
+            document.getElementById("logout_button").innerHTML = '<br>logout<br>(' + timeToLogout + ' s)';
     }
 }
 
index 4e3725f33090d85ca170aa06c3b6d1054fa78a81..95ee95e44adc52dce535031f9be38dd0a6e57dc4 100644 (file)
@@ -1,6 +1,6 @@
 {% if name %}
     <form style="position: absolute; right: 15%; width: 15%; height: 15%;">
-        <input type="button" value="logout" id="logout_button" onclick="logout()" style="width: 100%; height: 100%;">
+        <button type="button" id="logout_button" onclick="logout()" style="width: 100%; height: 100%;">logout</button>
     </form>
 
     <h1>Hello, {{ name }}!</h1>