]> git.proxmox.com Git - novnc-pve.git/blob - debian/patches/0017-make-error-hideable.patch
fix #3882: backport firefox workaround for ResizeObserver
[novnc-pve.git] / debian / patches / 0017-make-error-hideable.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Dominik Csapak <d.csapak@proxmox.com>
3 Date: Mon, 20 Dec 2021 09:34:36 +0100
4 Subject: [PATCH] make error hideable
5
6 by clicking on it
7
8 Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
9 ---
10 app/error-handler.js | 17 +++++++++++++++--
11 1 file changed, 15 insertions(+), 2 deletions(-)
12
13 diff --git a/app/error-handler.js b/app/error-handler.js
14 index f956c22..20233b2 100644
15 --- a/app/error-handler.js
16 +++ b/app/error-handler.js
17 @@ -15,6 +15,18 @@
18
19 (function _scope() {
20 "use strict";
21 + function hideError() {
22 + const msg = document.getElementById('noVNC_fallback_errormsg');
23 +
24 + // close it
25 + document.getElementById('noVNC_fallback_error')
26 + .classList.remove("noVNC_open");
27 +
28 + // remove all children
29 + while (msg.firstChild) {
30 + msg.removeChild(msg.firstChild);
31 + }
32 + }
33
34 // Fallback for all uncought errors
35 function handleError(event, err) {
36 @@ -58,8 +70,9 @@
37 msg.appendChild(div);
38 }
39
40 - document.getElementById('noVNC_fallback_error')
41 - .classList.add("noVNC_open");
42 + const node = document.getElementById('noVNC_fallback_error');
43 + node.classList.add("noVNC_open");
44 + node.onclick = hideError;
45 } catch (exc) {
46 document.write("noVNC encountered an error.");
47 }