commit bbdfebf8f6410b90123001b40e6451140aad6233
parent 3b402c564cb3bb4a41a9486f8522c8793dfdd2fb
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 6 Feb 2016 15:20:02 -0500
Avoid repeated search when clearing quick search bar
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
@@ -1967,8 +1967,10 @@ var ZoteroPane = new function()
});
+ /**
+ * Some keys trigger an immediate search
+ */
this.handleSearchKeypress = function (textbox, event) {
- // Events that turn find-as-you-type on
if (event.keyCode == event.DOM_VK_ESCAPE) {
textbox.value = '';
this.search();
@@ -1980,12 +1982,7 @@ var ZoteroPane = new function()
this.handleSearchInput = function (textbox, event) {
- // This is the new length, except, it seems, when the change is a
- // result of Undo or Redo
- if (!textbox.value.length) {
- this.search();
- }
- else if (textbox.value.indexOf('"') != -1) {
+ if (textbox.value.indexOf('"') != -1) {
this.setItemsPaneMessage(Zotero.getString('advancedSearchMode'));
}
}