Rename and move init function for fullscreen

This commit is contained in:
Samuel Mannehed 2017-01-23 13:25:55 +01:00
parent dceda58642
commit b3d91b78e1
1 changed files with 17 additions and 16 deletions

View File

@ -143,9 +143,10 @@ var UI;
UI.toggleControlbarSide(); UI.toggleControlbarSide();
} }
// Setup and initialize event handlers UI.initFullscreen();
// Setup event handlers
UI.setupWindowEvents(); UI.setupWindowEvents();
UI.setupFullscreen();
UI.addControlbarHandlers(); UI.addControlbarHandlers();
UI.addTouchSpecificHandlers(); UI.addTouchSpecificHandlers();
UI.addExtraKeysHandlers(); UI.addExtraKeysHandlers();
@ -180,6 +181,20 @@ var UI;
} }
}, },
initFullscreen: function() {
// Only show the button if fullscreen is properly supported
// * Safari doesn't support alphanumerical input while in fullscreen
if (!UI.isSafari &&
(document.documentElement.requestFullscreen ||
document.documentElement.mozRequestFullScreen ||
document.documentElement.webkitRequestFullscreen ||
document.body.msRequestFullscreen)) {
document.getElementById('noVNC_fullscreen_button')
.classList.remove("noVNC_hidden");
UI.addFullscreenHandlers();
}
},
initSettings: function() { initSettings: function() {
var i; var i;
@ -229,20 +244,6 @@ var UI;
.addEventListener('click', UI.hideStatus); .addEventListener('click', UI.hideStatus);
}, },
setupFullscreen: function() {
// Only show the button if fullscreen is properly supported
// * Safari doesn't support alphanumerical input while in fullscreen
if (!UI.isSafari &&
(document.documentElement.requestFullscreen ||
document.documentElement.mozRequestFullScreen ||
document.documentElement.webkitRequestFullscreen ||
document.body.msRequestFullscreen)) {
document.getElementById('noVNC_fullscreen_button')
.classList.remove("noVNC_hidden");
UI.addFullscreenHandlers();
}
},
addControlbarHandlers: function() { addControlbarHandlers: function() {
document.getElementById("noVNC_control_bar") document.getElementById("noVNC_control_bar")
.addEventListener('mousemove', UI.activateControlbar); .addEventListener('mousemove', UI.activateControlbar);