Fix stale references to old item tree DOM id

After the item tree refactor, the items tree id became "item-tree-main"
instead of "item-tree-main-default". Update the remaining call sites,
restoring collection highlighting on Ctrl/Option, focusing the item tree
after Add Item by Identifier, and Shift-Tab focus movement from the item
tree to the toolbar (which only still worked due to the native tab
order).
This commit is contained in:
Dan Stillman 2026-04-29 14:53:05 -04:00
parent 36e25d171a
commit a7d001fc1d
2 changed files with 3 additions and 3 deletions

View file

@ -147,7 +147,7 @@ var Zotero_Lookup = new function () {
// Send the focus to the item tree after the popup closes
ZoteroPane.lastFocusedElement = null;
document.getElementById("zotero-lookup-panel").hidePopup();
document.getElementById("item-tree-main-default").focus();
document.getElementById("item-tree-main").focus();
}
return false;
};

View file

@ -438,7 +438,7 @@ var ZoteroPane = new function () {
itemTree.addEventListener("keydown", (event) => {
let actionsMap = {
'item-tree-main-default': {
'item-tree-main': {
ShiftTab: () => document.getElementById('zotero-tb-toggle-item-pane-stacked')
}
};
@ -1066,7 +1066,7 @@ var ZoteroPane = new function () {
else {
enableHighlight = !event.shiftKey && !event.metaKey && event.key == "Control" && !event.altKey;
}
let isItemTreeFocused = document.activeElement.id == "item-tree-main-default";
let isItemTreeFocused = document.activeElement.id == "item-tree-main";
// Only highlight collections when itemTree is focused to try to avoid
// conflicts with other shortcuts
if (enableHighlight && isItemTreeFocused) {