]> git.wh0rd.org - tt-rss.git/blobdiff - functions.js
disable hotkey processing while searchbox is focused
[tt-rss.git] / functions.js
index 0b05ae2e8a0d71d2a220ba4d79d933832253df96..f33b3970d356307bc325a603b61022f75a69eb4e 100644 (file)
@@ -1,3 +1,13 @@
+var hotkeys_enabled = true;
+
+function disableHotkeys() {
+       hotkeys_enabled = false;
+}
+
+function enableHotkeys() {
+       hotkeys_enabled = true;
+}
+
 function notify_callback() {
        var container = document.getElementById('notify');
        if (xmlhttp.readyState == 4) {
@@ -56,8 +66,11 @@ function printLockingError() {
 var seq = "";
 
 function hotkey_handler(e) {
+
        var keycode;
 
+       if (!hotkeys_enabled) return;
+
        if (window.event) {
                keycode = window.event.keyCode;
        } else if (e) {