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:
parent
d79baf8251
commit
753032a001
1 changed files with 12 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue