pinned panes for reader contextPane

When tab selection changes, scroll to the pinned pane if there is one.
This commit is contained in:
Bogdan Abaev 2024-01-11 23:51:35 -05:00 committed by Dan Stillman
parent 6ac6c2582d
commit 30b4577283

View file

@ -223,6 +223,10 @@ var ZoteroContextPane = new function () {
_selectItemContext(ids[0]); _selectItemContext(ids[0]);
_update(); _update();
// When a loaded tab is selected, scroll to the pinned pane, if any
if (_sidenav.pinnedPane) {
_sidenav.scrollToPane(_sidenav.pinnedPane, 'instant');
}
} }
} }
}; };
@ -352,6 +356,7 @@ var ZoteroContextPane = new function () {
_updatePaneWidth(); _updatePaneWidth();
_updateAddToNote(); _updateAddToNote();
_sidenav.showPendingPane();
} }
function _togglePane(paneIndex) { function _togglePane(paneIndex) {
@ -927,5 +932,9 @@ var ZoteroContextPane = new function () {
if (_itemPaneDeck.selectedPanel === container) { if (_itemPaneDeck.selectedPanel === container) {
_sidenav.container = div; _sidenav.container = div;
} }
// When a tab is loaded, scroll to the pinned pane, if any
if (_sidenav.pinnedPane) {
_sidenav.scrollToPane(_sidenav.pinnedPane, 'instant');
}
} }
}; };