Cancel should close lookup panel
This commit is contained in:
parent
09e07df294
commit
617646f0a2
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
onpopuphidden="Zotero_Lookup.onHidden()" noautohide="true">
|
||||
<vbox>
|
||||
<description>&zotero.lookup.description;</description>
|
||||
<textbox id="zotero-lookup-textbox" style="margin: 2px 0 2px 0" onkeypress="if([13, 14].indexOf(event.keyCode) !== -1) { Zotero_Lookup.accept(); } return true;" flex="1"/>
|
||||
<textbox id="zotero-lookup-textbox" style="margin: 2px 0 2px 0" onkeypress="return Zotero_Lookup.onKeyPress(event)" flex="1"/>
|
||||
<hbox>
|
||||
<toolbarbutton class="zotero-small-progress-indicator" id="zotero-lookup-progress"/>
|
||||
<spacer flex="1"/>
|
||||
|
|
Loading…
Reference in New Issue
Block a user