Skip to content

Commit

Permalink
Remember control bar position
Browse files Browse the repository at this point in the history
  • Loading branch information
CendioOssman committed Nov 26, 2016
1 parent 8ee432f commit cf348b7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cf348b7

Please sign in to comment.