Focus title on shortcut key new item even if item type isn't changed

This commit is contained in:
Dan Stillman 2013-08-07 20:24:20 -04:00
parent e132787774
commit 8bdac7015b

View file

@ -658,14 +658,14 @@ var ZoteroPane = new function()
var handleTypeChange = function () {
self.addItemTypeToNewItemTypeMRU(this.itemTypeMenu.value);
itemBox.removeHandler('itemtypechange', handleTypeChange);
// Focus the title field after menu closes
itemBox.focusFirstField();
};
// Only update the MRU when the menu is opened for the
// keyboard shortcut, not on subsequent opens
var removeTypeChangeHandler = function () {
itemBox.removeHandler('itemtypechange', handleTypeChange);
itemBox.itemTypeMenu.firstChild.removeEventListener('popuphiding', removeTypeChangeHandler);
// Focus the title field after menu closes
itemBox.focusFirstField();
};
itemBox.addHandler('itemtypechange', handleTypeChange);
itemBox.itemTypeMenu.firstChild.addEventListener('popuphiding', removeTypeChangeHandler);