www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 9de109db1df75cf315800382ac13a91d34a37769
parent f60f3aa930e4d8868fc21579df911716a075eea0
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue, 26 Apr 2011 19:39:18 +0000

- Fix placeholder text switching in quicksearch box
- Open popup on Alt-Up/Down, as in Firefox search bar
- Don't re-run search when switching modes if search is empty


Diffstat:
Mchrome/content/zotero/xpcom/zotero.js | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -1569,6 +1569,7 @@ var Zotero = new function(){ 'oncommand', 'var mode = event.target.id.substr(22); ' + 'Zotero.Prefs.set("search.quicksearch-mode", mode);' + + 'if (document.getElementById("zotero-tb-search").value == "") { event.stopPropagation(); }' ); button.appendChild(menupopup); @@ -1580,6 +1581,16 @@ var Zotero = new function(){ else { searchBox.placeholder = modes[mode].label; } + + // If Alt-Up/Down, show popup + searchBox.setAttribute( + 'onkeypress', + searchBox.getAttribute('onkeypress') + "\n" + + "if (event.altKey && (event.keyCode == event.DOM_VK_UP || event.keyCode == event.DOM_VK_DOWN)) {" + + "document.getElementById('zotero-tb-search-menu-button').open = true;" + + "event.stopPropagation();" + + "}" + ); } @@ -1809,7 +1820,7 @@ Zotero.Prefs = new function(){ while (enumerator.hasMoreElements()) { var win = enumerator.getNext(); if (!win.ZoteroPane) continue; - win.ZoteroPane.updateQuickSearchBox(); + Zotero.updateQuickSearchBox(win.ZoteroPane.document); } break; }