mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
fix calltree nav when deep nesting
This commit is contained in:
@@ -170,6 +170,7 @@
|
||||
}
|
||||
.call_el {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
}
|
||||
.call_header {
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -81,16 +81,12 @@ export const scrollIntoViewIfNeeded = (container, target) => {
|
||||
if(target.offsetTop - container.scrollTop - container.offsetTop < 0){
|
||||
// The top of the target will be aligned to the top of the visible area of the scrollable ancestor
|
||||
target.scrollIntoView(true);
|
||||
// Do not scroll horizontally
|
||||
container.scrollLeft = 0
|
||||
}
|
||||
|
||||
// Target is outside the view from the bottom
|
||||
if(target.offsetTop - container.scrollTop - container.offsetTop - container.clientHeight + target.clientHeight > 0) {
|
||||
// The bottom of the target will be aligned to the bottom of the visible area of the scrollable ancestor.
|
||||
target.scrollIntoView(false);
|
||||
// Do not scroll horizontally
|
||||
container.scrollLeft = 0
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user