diff options
author | Pierre Ossman <ossman@cendio.se> | 2016-11-26 15:26:28 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2016-11-26 15:26:28 +0100 |
commit | cf348b7892f772bc10c4243408eb09cff5da4818 (patch) | |
tree | b48f956f763e9ab1377a9e9030013dc442117faf | |
parent | 8ee432f1db20f40cb3d693c80780c9c1b69820b5 (diff) | |
download | novnc-cf348b7892f772bc10c4243408eb09cff5da4818.tar.gz |
Remember control bar position
-rw-r--r-- | app/ui.js | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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; |