From 760966c15000eca3700d704b86999b4875f03eb9 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 25 Aug 2005 14:31:52 +0100 Subject: [PATCH] disable hotkey processing while searchbox is focused --- backend.php | 4 +++- functions.js | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/backend.php b/backend.php index d29cc280b..dd38641ac 100644 --- a/backend.php +++ b/backend.php @@ -245,7 +245,9 @@ $feed_last_updated = "Updated: " . $line["last_updated"]; print " - Search: + Search: Reset "; print " diff --git a/functions.js b/functions.js index 0b05ae2e8..f33b3970d 100644 --- a/functions.js +++ b/functions.js @@ -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) {