diff options
author | Pierre Ossman <ossman@cendio.se> | 2017-10-30 17:16:03 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2017-11-01 09:24:28 +0100 |
commit | 94d42e36ee09d7f232c35ba94fa3fd8a461b2f17 (patch) | |
tree | 21c72899da326bd7c2084127d9e6e48c6451741c | |
parent | cede1fa494fec189f3fca6f508689905dade113b (diff) | |
download | novnc-api.tar.gz |
Prevent password form submission earlyapi
Otherwise it might reload the page if we run in to some kind of
error.
-rw-r--r-- | app/ui.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1120,6 +1120,9 @@ var UI = { }, setPassword: function(e) { + // Prevent actually submitting the form + e.preventDefault(); + var inputElem = document.getElementById('noVNC_password_input'); var password = inputElem.value; // Clear the input after reading the password @@ -1128,8 +1131,6 @@ var UI = { UI.reconnect_password = password; document.getElementById('noVNC_password_dlg') .classList.remove('noVNC_open'); - // Prevent actually submitting the form - e.preventDefault(); }, /* ------^------- |