Prevent password form submission early

Otherwise it might reload the page if we run in to some kind of
error.
This commit is contained in:
Pierre Ossman 2017-10-30 17:16:03 +01:00
parent e89eef94aa
commit a80b5fdaaf
1 changed files with 3 additions and 2 deletions

View File

@ -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();
},
/* ------^-------