Consistently close dialogs on connect/disconnect

This was done a bit arbitrarily before which could easily miss things,
end up in the wrong state and not trigger animations correctly.

This reverts commit c12e5b2b54 and fixes
things in a different way.
This commit is contained in:
Pierre Ossman 2020-05-05 12:14:49 +02:00
parent 776cda5dc4
commit 42e3b03fa8
3 changed files with 28 additions and 33 deletions

View File

@ -635,7 +635,7 @@ select:active {
} }
/* Extra manual keys */ /* Extra manual keys */
:root:not(.noVNC_connected) #noVNC_extra_keys { :root:not(.noVNC_connected) #noVNC_toggle_extra_keys_button {
display: none; display: none;
} }
@ -663,9 +663,6 @@ select:active {
:root:not(.noVNC_connected) #noVNC_clipboard_button { :root:not(.noVNC_connected) #noVNC_clipboard_button {
display: none; display: none;
} }
:root:not(.noVNC_connected) #noVNC_clipboard {
display: none;
}
#noVNC_clipboard { #noVNC_clipboard {
/* Full screen, minus padding and left and right margins */ /* Full screen, minus padding and left and right margins */
max-width: calc(100vw - 2*15px - 75px - 25px); max-width: calc(100vw - 2*15px - 75px - 25px);

View File

@ -445,7 +445,9 @@ const UI = {
UI.keepControlbar(); UI.keepControlbar();
} }
// State change closes the password dialog // State change closes dialogs as they may not be relevant
// anymore
UI.closeAllPanels();
document.getElementById('noVNC_credentials_dlg') document.getElementById('noVNC_credentials_dlg')
.classList.remove('noVNC_open'); .classList.remove('noVNC_open');
}, },
@ -1016,7 +1018,6 @@ const UI = {
return; return;
} }
UI.closeAllPanels();
UI.closeConnectPanel(); UI.closeConnectPanel();
UI.updateVisualState('connecting'); UI.updateVisualState('connecting');
@ -1054,7 +1055,6 @@ const UI = {
}, },
disconnect() { disconnect() {
UI.closeAllPanels();
UI.rfb.disconnect(); UI.rfb.disconnect();
UI.connected = false; UI.connected = false;

View File

@ -111,32 +111,30 @@
</div> </div>
<!-- Extra manual keys --> <!-- Extra manual keys -->
<div id="noVNC_extra_keys"> <input type="image" alt="Extra keys" src="app/images/toggleextrakeys.svg"
<input type="image" alt="Extra keys" src="app/images/toggleextrakeys.svg" id="noVNC_toggle_extra_keys_button" class="noVNC_button"
id="noVNC_toggle_extra_keys_button" class="noVNC_button" title="Show Extra Keys">
title="Show Extra Keys"> <div class="noVNC_vcenter">
<div class="noVNC_vcenter"> <div id="noVNC_modifiers" class="noVNC_panel">
<div id="noVNC_modifiers" class="noVNC_panel"> <input type="image" alt="Ctrl" src="app/images/ctrl.svg"
<input type="image" alt="Ctrl" src="app/images/ctrl.svg" id="noVNC_toggle_ctrl_button" class="noVNC_button"
id="noVNC_toggle_ctrl_button" class="noVNC_button" title="Toggle Ctrl">
title="Toggle Ctrl"> <input type="image" alt="Alt" src="app/images/alt.svg"
<input type="image" alt="Alt" src="app/images/alt.svg" id="noVNC_toggle_alt_button" class="noVNC_button"
id="noVNC_toggle_alt_button" class="noVNC_button" title="Toggle Alt">
title="Toggle Alt"> <input type="image" alt="Windows" src="app/images/windows.svg"
<input type="image" alt="Windows" src="app/images/windows.svg" id="noVNC_toggle_windows_button" class="noVNC_button"
id="noVNC_toggle_windows_button" class="noVNC_button" title="Toggle Windows">
title="Toggle Windows"> <input type="image" alt="Tab" src="app/images/tab.svg"
<input type="image" alt="Tab" src="app/images/tab.svg" id="noVNC_send_tab_button" class="noVNC_button"
id="noVNC_send_tab_button" class="noVNC_button" title="Send Tab">
title="Send Tab"> <input type="image" alt="Esc" src="app/images/esc.svg"
<input type="image" alt="Esc" src="app/images/esc.svg" id="noVNC_send_esc_button" class="noVNC_button"
id="noVNC_send_esc_button" class="noVNC_button" title="Send Escape">
title="Send Escape"> <input type="image" alt="Ctrl+Alt+Del" src="app/images/ctrlaltdel.svg"
<input type="image" alt="Ctrl+Alt+Del" src="app/images/ctrlaltdel.svg" id="noVNC_send_ctrl_alt_del_button" class="noVNC_button"
id="noVNC_send_ctrl_alt_del_button" class="noVNC_button" title="Send Ctrl-Alt-Del">
title="Send Ctrl-Alt-Del"> </div>
</div>
</div>
</div> </div>
<!-- Shutdown/Reboot --> <!-- Shutdown/Reboot -->