mirror of
https://github.com/novnc/noVNC.git
synced 2026-05-28 16:09:41 +00:00
Remember control bar position
This commit is contained in:
13
app/ui.js
13
app/ui.js
@@ -109,6 +109,11 @@ var UI;
|
||||
UI.initSetting('clip', false);
|
||||
}
|
||||
|
||||
// Restore control bar position
|
||||
if (WebUtil.readSetting('controlbar_pos') === 'right') {
|
||||
UI.toggleControlbarSide();
|
||||
}
|
||||
|
||||
// Setup and initialize event handlers
|
||||
UI.setupWindowEvents();
|
||||
UI.setupFullscreen();
|
||||
@@ -583,7 +588,13 @@ var UI;
|
||||
bar.addEventListener('transitionend', function () { this.style.transitionDuration = ""; });
|
||||
|
||||
var anchor = document.getElementById('noVNC_control_bar_anchor');
|
||||
anchor.classList.toggle("noVNC_right");
|
||||
if (anchor.classList.contains("noVNC_right")) {
|
||||
WebUtil.writeSetting('controlbar_pos', 'left');
|
||||
anchor.classList.remove("noVNC_right");
|
||||
} else {
|
||||
WebUtil.writeSetting('controlbar_pos', 'right');
|
||||
anchor.classList.add("noVNC_right");
|
||||
}
|
||||
|
||||
// Consider this a movement of the handle
|
||||
UI.controlbarDrag = true;
|
||||
|
||||
Reference in New Issue
Block a user