Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
- app/error-handler.js | 17 +++++++++++++++--
- 1 file changed, 15 insertions(+), 2 deletions(-)
+ app/error-handler.js | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/app/error-handler.js b/app/error-handler.js
-index f956c22..20233b2 100644
+index 67b6372..b842909 100644
--- a/app/error-handler.js
+++ b/app/error-handler.js
-@@ -15,6 +15,18 @@
+@@ -6,6 +6,19 @@
+ * See README.md for usage and integration instructions.
+ */
- (function _scope() {
- "use strict";
-+ function hideError() {
-+ const msg = document.getElementById('noVNC_fallback_errormsg');
++function hideError() {
++ const msg = document.getElementById('noVNC_fallback_errormsg');
+
-+ // close it
-+ document.getElementById('noVNC_fallback_error')
-+ .classList.remove("noVNC_open");
++ // close it
++ document.getElementById('noVNC_fallback_error')
++ .classList.remove("noVNC_open");
+
-+ // remove all children
-+ while (msg.firstChild) {
-+ msg.removeChild(msg.firstChild);
-+ }
++ // remove all children
++ while (msg.firstChild) {
++ msg.removeChild(msg.firstChild);
+ }
++}
++
+ // Fallback for all uncought errors
+ function handleError(event, err) {
+ try {
+@@ -48,8 +61,9 @@ function handleError(event, err) {
+ msg.appendChild(div);
+ }
- // Fallback for all uncought errors
- function handleError(event, err) {
-@@ -58,8 +70,9 @@
- msg.appendChild(div);
- }
+- document.getElementById('noVNC_fallback_error')
+- .classList.add("noVNC_open");
++ const node = document.getElementById('noVNC_fallback_error');
++ node.classList.add("noVNC_open");
++ node.onclick = hideError;
-- document.getElementById('noVNC_fallback_error')
-- .classList.add("noVNC_open");
-+ const node = document.getElementById('noVNC_fallback_error');
-+ node.classList.add("noVNC_open");
-+ node.onclick = hideError;
- } catch (exc) {
- document.write("noVNC encountered an error.");
- }
+ } catch (exc) {
+ document.write("noVNC encountered an error.");