From 5b7598ac6bdf24ee6fb0dc6616b08551d12f815f Mon Sep 17 00:00:00 2001 From: samhed Date: Fri, 6 Feb 2015 15:53:10 +0100 Subject: [PATCH] Use our own event registration function for keyboardinputReset. --- include/ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/ui.js b/include/ui.js index 4748ff00..4132d050 100644 --- a/include/ui.js +++ b/include/ui.js @@ -17,7 +17,6 @@ var UI; // Load supporting scripts window.onscriptsload = function () { UI.load(); }; - window.onload = function () { UI.keyboardinputReset(); }; Util.load_scripts(["webutil.js", "base64.js", "websock.js", "des.js", "keysymdef.js", "keyboard.js", "input.js", "display.js", "jsunzip.js", "rfb.js", "keysym.js"]); @@ -139,6 +138,8 @@ var UI; UI.setViewClip(); Util.addEvent(window, 'resize', UI.setViewClip); + Util.addEvent(window, 'load', UI.keyboardinputReset); + Util.addEvent(window, 'beforeunload', function () { if (UI.rfb_state === 'normal') { return "You are currently connected.";