citation dlg: highlight bubble when table focused (#5142)

In library mode, apply highlighting to bubbles that
correspond to selected items in itemTree only when
the items table is focused. When the focus leaves,
highlighting is removed from bubbles.

Fixes: #5138
This commit is contained in:
abaevbog 2025-03-20 14:20:22 -07:00 committed by GitHub
parent d79baf8251
commit 753032a001
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -533,6 +533,10 @@ class LibraryLayout extends Layout {
itemsTree.addEventListener("mousemove", event => this._handleItemsViewMouseMove(event));
// handle backspace to remove an item from citation
itemsTree.addEventListener("keypress", event => this._handleItemsViewKeyPress(event));
// only highlight bubbles of selected rows when the focus is in itemTree
// when focus leaves the items table, bubbles highlighting is removed
itemsTree.addEventListener("focusin", this.updateSelectedItems);
itemsTree.addEventListener("focusout", this._clearSelectedBubbles);
this._refreshItemsViewHighlightedRows();
}
@ -692,6 +696,14 @@ class LibraryLayout extends Layout {
rowAfterRefresh.closest(".virtualized-table-body").scrollTop += delta;
}
}
// remove selected highlight from all bubbles
_clearSelectedBubbles() {
for (let itemObj of CitationDataManager.items) {
itemObj.selected = false;
}
IOManager.updateBubbleInput();
}
}
class ListLayout extends Layout {