Module: check_mk
Branch: master
Commit: 7df00fd8d7e4e3e002d8e6414f85a5a59ab3a59d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7df00fd8d7e4e3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Mar 23 17:14:39 2013 +0100
htmllib: clear key modifiers after loosing focus
---
web/htdocs/htmllib.py | 1 +
web/htdocs/js/checkmk.js | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index c4afaad..5165489 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -929,6 +929,7 @@ class html:
self.javascript("""var keybindings = %r;\n
document.body.onkeydown = keybindings_keydown;
document.body.onkeyup = keybindings_keyup;
+document.body.onfocus = keybindings_focus;
""" % self.keybindings)
if self.final_javascript_code:
self.javascript(self.final_javascript_code);
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index c196b0c..202501a 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -1953,6 +1953,11 @@ function keybindings_keyup(e) {
}
}
+function keybindings_focus(e) {
+ keybindings_pressedkeys = [];
+}
+
+
function keybindings_check(e) {
for (var i in keybindings) {
var keylist = keybindings[i][0];