Fix tabbing in tags pane (broken by last commit) and make ensureItemIsVisible() work for tags
This commit is contained in:
parent
4ff95b1715
commit
9eb58db5a3
|
@ -102,7 +102,7 @@
|
||||||
if (this.id('tagRows').lastChild)
|
if (this.id('tagRows').lastChild)
|
||||||
{
|
{
|
||||||
tabindex = parseInt(this.id('tagRows').lastChild.
|
tabindex = parseInt(this.id('tagRows').lastChild.
|
||||||
firstChild.nextSibling.getAttribute('tabindex')) + 1;
|
firstChild.nextSibling.getAttribute('ztabindex')) + 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tabindex = 1;
|
tabindex = 1;
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
remove.setAttribute('class','zotero-clicky');
|
remove.setAttribute('class','zotero-clicky');
|
||||||
if (id)
|
if (id)
|
||||||
{
|
{
|
||||||
remove.setAttribute('tabindex', -1);
|
remove.setAttribute('ztabindex', -1);
|
||||||
remove.setAttribute('onclick',"this.parentNode.parentNode.parentNode.parentNode.parentNode.remove('"+id+"');");
|
remove.setAttribute('onclick',"this.parentNode.parentNode.parentNode.parentNode.parentNode.remove('"+id+"');");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -246,9 +246,16 @@
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="getScrollBox">
|
||||||
|
<body>
|
||||||
|
<![CDATA[
|
||||||
|
return document.getAnonymousNodes(this)[0];
|
||||||
|
]]>
|
||||||
|
</body>
|
||||||
|
</method>
|
||||||
</implementation>
|
</implementation>
|
||||||
<content>
|
<content>
|
||||||
<xul:vbox xbl:inherits="flex">
|
<xul:scrollbox xbl:inherits="flex" orient="vertical" style="overflow:auto">
|
||||||
<xul:hbox align="center">
|
<xul:hbox align="center">
|
||||||
<xul:label id="tagsNum"/>
|
<xul:label id="tagsNum"/>
|
||||||
<xul:button label="&zotero.item.add;" oncommand="this.parentNode.parentNode.parentNode.new();"/>
|
<xul:button label="&zotero.item.add;" oncommand="this.parentNode.parentNode.parentNode.new();"/>
|
||||||
|
@ -261,7 +268,7 @@
|
||||||
</xul:columns>
|
</xul:columns>
|
||||||
<xul:rows id="tagRows"/>
|
<xul:rows id="tagRows"/>
|
||||||
</xul:grid>
|
</xul:grid>
|
||||||
</xul:vbox>
|
</xul:scrollbox>
|
||||||
</content>
|
</content>
|
||||||
</binding>
|
</binding>
|
||||||
</bindings>
|
</bindings>
|
|
@ -35,6 +35,7 @@ var ZoteroItemPane = new function()
|
||||||
var _loaded;
|
var _loaded;
|
||||||
|
|
||||||
var _itemBeingEdited;
|
var _itemBeingEdited;
|
||||||
|
var _activeScrollbox;
|
||||||
|
|
||||||
var _lastTabIndex;
|
var _lastTabIndex;
|
||||||
var _tabDirection;
|
var _tabDirection;
|
||||||
|
@ -165,6 +166,8 @@ var ZoteroItemPane = new function()
|
||||||
// Info pane
|
// Info pane
|
||||||
if(index == 0)
|
if(index == 0)
|
||||||
{
|
{
|
||||||
|
_activeScrollbox = document.getElementById('zotero-info');
|
||||||
|
|
||||||
// Enable/disable "View =>" button
|
// Enable/disable "View =>" button
|
||||||
testView: try
|
testView: try
|
||||||
{
|
{
|
||||||
|
@ -400,6 +403,7 @@ var ZoteroItemPane = new function()
|
||||||
// Tags pane
|
// Tags pane
|
||||||
else if(index == 3)
|
else if(index == 3)
|
||||||
{
|
{
|
||||||
|
_activeScrollbox = document.getElementById('zotero-editpane-tags').getScrollBox();
|
||||||
var focusMode = 'tags';
|
var focusMode = 'tags';
|
||||||
var focusBox = _tagsBox;
|
var focusBox = _tagsBox;
|
||||||
_tagsBox.item = _itemBeingEdited;
|
_tagsBox.item = _itemBeingEdited;
|
||||||
|
@ -421,14 +425,20 @@ var ZoteroItemPane = new function()
|
||||||
|
|
||||||
|
|
||||||
function scrollToTop() {
|
function scrollToTop() {
|
||||||
var sbo = document.getElementById('zotero-info').boxObject;
|
if (!_activeScrollbox) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var sbo = _activeScrollbox.boxObject;
|
||||||
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject);
|
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject);
|
||||||
sbo.scrollTo(0,0);
|
sbo.scrollTo(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function ensureElementIsVisible(elem) {
|
function ensureElementIsVisible(elem) {
|
||||||
var sbo = document.getElementById('zotero-info').boxObject;
|
if (!_activeScrollbox) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var sbo = _activeScrollbox.boxObject;
|
||||||
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject);
|
sbo.QueryInterface(Components.interfaces.nsIScrollBoxObject);
|
||||||
sbo.ensureElementIsVisible(elem);
|
sbo.ensureElementIsVisible(elem);
|
||||||
}
|
}
|
||||||
|
@ -1189,8 +1199,9 @@ var ZoteroItemPane = new function()
|
||||||
}
|
}
|
||||||
_focusNextField(focusMode, focusBox, _lastTabIndex, _tabDirection==-1);
|
_focusNextField(focusMode, focusBox, _lastTabIndex, _tabDirection==-1);
|
||||||
}
|
}
|
||||||
// If not tab, return focus to items pane
|
// If not tab and not new tag, return focus to items pane
|
||||||
else {
|
// DEBUG: is this the best place for this?
|
||||||
|
else if (focusMode != 'tags') {
|
||||||
document.getElementById('zotero-items-tree').focus();
|
document.getElementById('zotero-items-tree').focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
<rows id="zotero-editpane-dynamic-attachments" flex="1"/>
|
<rows id="zotero-editpane-dynamic-attachments" flex="1"/>
|
||||||
</grid>
|
</grid>
|
||||||
</vbox>
|
</vbox>
|
||||||
<tagsbox id="zotero-editpane-tags" flex="1" style="overflow:auto"/>
|
<tagsbox id="zotero-editpane-tags" flex="1"/>
|
||||||
<seealsobox id="zotero-editpane-related" flex="1"/>
|
<seealsobox id="zotero-editpane-related" flex="1"/>
|
||||||
</deck>
|
</deck>
|
||||||
</overlay>
|
</overlay>
|
Loading…
Reference in New Issue
Block a user