Addresses #283, Minefield compatibility
Closes #285, Hitting Esc should close tags popup Fixes various UI issues and problems adding tags on Minefield Still getting autocomplete self-destruction
This commit is contained in:
parent
1159de39f6
commit
34ea8ced85
7 changed files with 27 additions and 12 deletions
|
@ -36,6 +36,8 @@ locale zotero zh-TW chrome/locale/zh-TW/zotero/
|
|||
skin zotero default chrome/skin/default/zotero/
|
||||
|
||||
overlay chrome://browser/content/browser.xul chrome://zotero/content/overlay.xul
|
||||
overlay chrome://browser/content/browser.xul chrome://zotero/content/itemPane.xul
|
||||
|
||||
style chrome://browser/content/browser.xul chrome://zotero/skin/zotero.css
|
||||
style chrome://global/content/customizeToolbar.xul chrome://zotero/skin/zotero.css
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@
|
|||
Note: Code in tagsbox.xml is dependent on the DOM path between the
|
||||
tagsbox and tagsLabel above, so be sure to update fixPopup() if it changes
|
||||
-->
|
||||
<xul:popup id="tagsPopup" ignorekeys="true" width="300"
|
||||
<xul:popup id="tagsPopup" ignorekeys="true"
|
||||
onpopupshown="if (!document.commandDispatcher.focusedElement || document.commandDispatcher.focusedElement.tagName=='xul:label'){ /* DEBUG: it would be nice to make this work -- if (this.firstChild.count==0){ this.firstChild.new(); } */ this.setAttribute('showing', 'true'); }"
|
||||
onpopuphidden="if (!document.commandDispatcher.focusedElement || document.commandDispatcher.focusedElement.tagName=='xul:label'){ this.setAttribute('showing', 'false'); }">
|
||||
<xul:tagsbox id="tags" flex="1"/>
|
||||
|
|
|
@ -265,8 +265,8 @@
|
|||
<method name="closePopup">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this.parentNode.getAttribute('showing')=='true') {
|
||||
this.parentNode.setAttribute('showing', false);
|
||||
if (this.parentNode.hidePopup) {
|
||||
this.parentNode.hidePopup()
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
|
@ -283,7 +283,7 @@
|
|||
<xul:scrollbox xbl:inherits="flex" orient="vertical" style="overflow:auto">
|
||||
<xul:hbox align="center">
|
||||
<xul:label id="tagsNum"/>
|
||||
<xul:button label="&zotero.item.add;" oncommand="this.parentNode.parentNode.parentNode.new();"/>
|
||||
<xul:button label="&zotero.item.add;" oncommand="document.getBindingParent(this).new();"/>
|
||||
</xul:hbox>
|
||||
<xul:grid>
|
||||
<xul:columns>
|
||||
|
|
|
@ -1006,7 +1006,7 @@ var ZoteroItemPane = new function()
|
|||
_dynamicFields.focus();
|
||||
}
|
||||
|
||||
//Zotero.debug('Showing editor');
|
||||
Zotero.debug('Showing editor');
|
||||
|
||||
var fieldName = elem.getAttribute('fieldname');
|
||||
var tabindex = elem.getAttribute('ztabindex');
|
||||
|
@ -1167,6 +1167,9 @@ var ZoteroItemPane = new function()
|
|||
switch (event.keyCode)
|
||||
{
|
||||
case event.DOM_VK_RETURN:
|
||||
// Prevent blur on textbox above
|
||||
event.preventDefault();
|
||||
|
||||
var fieldname = target.getAttribute('fieldname');
|
||||
// Use shift-enter as the save action for the larger fields
|
||||
if ((fieldname == 'abstractNote' || fieldname == 'extra')
|
||||
|
@ -1220,8 +1223,15 @@ var ZoteroItemPane = new function()
|
|||
case event.DOM_VK_ESCAPE:
|
||||
// Reset field to original value
|
||||
target.value = target.getAttribute('value');
|
||||
|
||||
var tagsbox = Zotero.getAncestorByTagName(focused, 'tagsbox');
|
||||
|
||||
focused.blur();
|
||||
|
||||
if (tagsbox) {
|
||||
tagsbox.closePopup();
|
||||
}
|
||||
|
||||
// Return focus to items pane
|
||||
var tree = document.getElementById('zotero-items-tree');
|
||||
if (tree) {
|
||||
|
@ -1243,12 +1253,13 @@ var ZoteroItemPane = new function()
|
|||
|
||||
function hideEditor(t, saveChanges)
|
||||
{
|
||||
//Zotero.debug('Hiding editor');
|
||||
Zotero.debug('Hiding editor');
|
||||
var textbox = Zotero.getAncestorByTagName(t, 'textbox');
|
||||
if (!textbox){
|
||||
Zotero.debug('Textbox not found in hideEditor');
|
||||
return;
|
||||
}
|
||||
|
||||
var fieldName = textbox.getAttribute('fieldname');
|
||||
var tabindex = textbox.getAttribute('ztabindex');
|
||||
|
||||
|
@ -1349,10 +1360,7 @@ var ZoteroItemPane = new function()
|
|||
if (existingTypes && existingTypes.indexOf(1) != -1) {
|
||||
_lastTabIndex--;
|
||||
}
|
||||
|
||||
var id = tagsbox.add(value);
|
||||
|
||||
// DEBUG: why does this need to continue if added?
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1370,6 +1378,7 @@ var ZoteroItemPane = new function()
|
|||
}
|
||||
catch (e) {}
|
||||
tagsbox.fixPopup();
|
||||
tagsbox.closePopup();
|
||||
|
||||
_tabDirection = false;
|
||||
return;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
-->
|
||||
<?xml-stylesheet href="chrome://zotero/skin/itemPane.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://zotero-platform/content/itemPane.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||
|
||||
<overlay
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
<overlay id="zotero"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<?xul-overlay href="itemPane.xul" ?>
|
||||
|
||||
<!-- Include the global XPCOM object -->
|
||||
<script src="include.js"/>
|
||||
|
|
|
@ -8,3 +8,7 @@
|
|||
{
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
#tagsPopup {
|
||||
min-width: 300px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue