From 617646f0a26ddc653734608fa19a86da38501102 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sun, 24 Jul 2011 17:49:16 +0000 Subject: [PATCH] Cancel should close lookup panel --- chrome/content/zotero/lookup.js | 13 +++++++++++++ chrome/content/zotero/zoteroPane.xul | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/lookup.js b/chrome/content/zotero/lookup.js index 418e0f4bd..b6dc36d7e 100644 --- a/chrome/content/zotero/lookup.js +++ b/chrome/content/zotero/lookup.js @@ -91,6 +91,19 @@ const Zotero_Lookup = new function () { return false; } + /** + * Handles a key press + */ + this.onKeyPress = function(event) { + var keyCode = event.keyCode; + if(keyCode === 13 || keyCode === 14) { + Zotero_Lookup.accept(); + } else if(keyCode == event.DOM_VK_ESCAPE) { + document.getElementById("zotero-lookup-panel").hidePopup(); + } + return true; + } + /** * Focuses the field */ diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index 2d17a8d24..f4e94f9c5 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -145,7 +145,7 @@ onpopuphidden="Zotero_Lookup.onHidden()" noautohide="true"> &zotero.lookup.description; - +