From b3d91b78e132494fcfa2fdafa1c85caff8788bd0 Mon Sep 17 00:00:00 2001
From: Samuel Mannehed <samuel@cendio.se>
Date: Mon, 23 Jan 2017 13:25:55 +0100
Subject: [PATCH] Rename and move init function for fullscreen

---
 app/ui.js | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/app/ui.js b/app/ui.js
index 5fda992..8c208eb 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -143,9 +143,10 @@ var UI;
                 UI.toggleControlbarSide();
             }
 
-            // Setup and initialize event handlers
+            UI.initFullscreen();
+
+            // Setup event handlers
             UI.setupWindowEvents();
-            UI.setupFullscreen();
             UI.addControlbarHandlers();
             UI.addTouchSpecificHandlers();
             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() {
             var i;
 
@@ -229,20 +244,6 @@ var UI;
                 .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() {
             document.getElementById("noVNC_control_bar")
                 .addEventListener('mousemove', UI.activateControlbar);
-- 
GitLab