Trigger autoconnect at proper time

It needs to happen after everything is fully initialised.
This commit is contained in:
samhed 2016-08-24 16:35:44 +02:00 committed by Pierre Ossman
parent 2869308c80
commit 17eb0fcf50
1 changed files with 8 additions and 8 deletions

View File

@ -115,14 +115,6 @@ var UI;
UI.initSetting('repeaterID', '');
UI.initSetting('token', '');
var autoconnect = WebUtil.getConfigVar('autoconnect', false);
if (autoconnect === 'true' || autoconnect == '1') {
autoconnect = true;
UI.connect();
} else {
autoconnect = false;
}
UI.updateVisualState();
document.getElementById('noVNC_setting_host').focus();
@ -194,6 +186,14 @@ var UI;
// Add mouse event click/focus/blur event handlers to the UI
UI.addMouseHandlers();
var autoconnect = WebUtil.getConfigVar('autoconnect', false);
if (autoconnect === 'true' || autoconnect == '1') {
autoconnect = true;
UI.connect();
} else {
autoconnect = false;
}
if (typeof callback === "function") {
callback(UI.rfb);
}