Use return to exit arrow panel and move locator to top

This commit is contained in:
Simon Kornblith 2011-07-29 05:43:42 +00:00
parent a66555e45b
commit 352a49723e
2 changed files with 12 additions and 10 deletions

View File

@ -1,7 +1,7 @@
/* /*
***** BEGIN LICENSE BLOCK ***** ***** BEGIN LICENSE BLOCK *****
Copyright © 2009 Center for History and New Media Copyright © 2011 Center for History and New Media
George Mason University, Fairfax, Virginia, USA George Mason University, Fairfax, Virginia, USA
http://zotero.org http://zotero.org
@ -432,7 +432,7 @@ var Zotero_QuickFormat = new function () {
/** /**
* Accepts current selection and adds citation * Accepts current selection and adds citation
*/ */
_accept = function() { function _accept() {
var nodes = qfe.childNodes; var nodes = qfe.childNodes;
io.citation.citationItems = []; io.citation.citationItems = [];
for(var i=0, n=nodes.length; i<n; i++) { for(var i=0, n=nodes.length; i<n; i++) {
@ -548,6 +548,7 @@ var Zotero_QuickFormat = new function () {
target.setAttribute("selected", "true"); target.setAttribute("selected", "true");
panel.openPopup(target, "after_start", panel.openPopup(target, "after_start",
target.clientWidth/2, 0, false, false, event); target.clientWidth/2, 0, false, false, event);
locator.focus();
var closeListener = function(event) { var closeListener = function(event) {
panel.removeEventListener("popuphidden", closeListener, false); panel.removeEventListener("popuphidden", closeListener, false);
@ -603,8 +604,9 @@ var Zotero_QuickFormat = new function () {
* Makes "Enter" work in the panel * Makes "Enter" work in the panel
*/ */
this.onPanelKeyPress = function(event) { this.onPanelKeyPress = function(event) {
var keyCode = event.keyCode;
if(keyCode === event.DOM_VK_RETURN || keyCode === event.DOM_VK_ENTER) { if(keyCode === event.DOM_VK_RETURN || keyCode === event.DOM_VK_ENTER) {
event.target.hidePopup(); document.getElementById("citation-properties").hidePopup();
} }
}; };

View File

@ -53,13 +53,19 @@
</hbox> </hbox>
<richlistbox id="quick-format-reference-list" hidden="true" flex="1"/> <richlistbox id="quick-format-reference-list" hidden="true" flex="1"/>
</vbox> </vbox>
<panel id="citation-properties" type="arrow" orient="vertical" onkeypress="Zotero_QuickStart.onPanelKeyPress(event)"> <panel id="citation-properties" type="arrow" orient="vertical" onkeypress="Zotero_QuickFormat.onPanelKeyPress(event)">
<grid flex="1"> <grid flex="1">
<columns> <columns>
<column/> <column/>
<column flex="1"/> <column flex="1"/>
</columns> </columns>
<rows> <rows>
<row align="center">
<menulist id="locator-label" sizetopopup="none">
<menupopup id="locator-label-popup"/>
</menulist>
<textbox id="locator" flex="1"/>
</row>
<row align="center"> <row align="center">
<label value="&zotero.citation.prefix.label;"/> <label value="&zotero.citation.prefix.label;"/>
<textbox class="citation-textbox" id="prefix" flex="1"/> <textbox class="citation-textbox" id="prefix" flex="1"/>
@ -68,12 +74,6 @@
<label value="&zotero.citation.suffix.label;"/> <label value="&zotero.citation.suffix.label;"/>
<textbox class="citation-textbox" id="suffix" flex="1"/> <textbox class="citation-textbox" id="suffix" flex="1"/>
</row> </row>
<row align="center">
<menulist id="locator-label" sizetopopup="none">
<menupopup id="locator-label-popup"/>
</menulist>
<textbox id="locator" flex="1"/>
</row>
<checkbox id="suppress-author" label="&zotero.citation.suppressAuthor.label;"/> <checkbox id="suppress-author" label="&zotero.citation.suppressAuthor.label;"/>
</rows> </rows>
</grid> </grid>