Keep focus in creator field when using two-field autocomplete
This commit is contained in:
parent
f5fb1fa806
commit
107c1bdf4b
2 changed files with 10 additions and 9 deletions
|
@ -504,8 +504,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var focusMode = 'info';
|
// Move to next or previous field if (shift-)tab was pressed
|
||||||
var focusBox = this._dynamicFields;
|
if (this._lastTabIndex && this._tabDirection)
|
||||||
|
{
|
||||||
|
this._focusNextField('info', this._dynamicFields, this._lastTabIndex, this._tabDirection == -1);
|
||||||
|
}
|
||||||
|
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
@ -1286,6 +1290,10 @@
|
||||||
var [field, creatorIndex, creatorField] =
|
var [field, creatorIndex, creatorField] =
|
||||||
textbox.getAttribute('fieldname').split('-');
|
textbox.getAttribute('fieldname').split('-');
|
||||||
|
|
||||||
|
// Stay focused
|
||||||
|
this._lastTabIndex = parseInt(textbox.getAttribute('ztabindex')) - 1;
|
||||||
|
this._tabDirection = 1;
|
||||||
|
|
||||||
var creator = Zotero.Creators.get(creatorID);
|
var creator = Zotero.Creators.get(creatorID);
|
||||||
|
|
||||||
var otherField = creatorField == 'lastName' ? 'firstName' : 'lastName';
|
var otherField = creatorField == 'lastName' ? 'firstName' : 'lastName';
|
||||||
|
|
|
@ -254,13 +254,6 @@ var ZoteroItemPane = new function() {
|
||||||
{
|
{
|
||||||
_relatedBox.item = _itemBeingEdited;
|
_relatedBox.item = _itemBeingEdited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Move to next or previous field if (shift-)tab was pressed
|
|
||||||
if (focusMode && _lastTabIndex && _tabDirection)
|
|
||||||
{
|
|
||||||
_focusNextField(focusMode, focusBox, _lastTabIndex, _tabDirection==-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue