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 {
|
.call_el {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
.call_header {
|
.call_header {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
@@ -81,16 +81,12 @@ export const scrollIntoViewIfNeeded = (container, target) => {
|
|||||||
if(target.offsetTop - container.scrollTop - container.offsetTop < 0){
|
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
|
// The top of the target will be aligned to the top of the visible area of the scrollable ancestor
|
||||||
target.scrollIntoView(true);
|
target.scrollIntoView(true);
|
||||||
// Do not scroll horizontally
|
|
||||||
container.scrollLeft = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Target is outside the view from the bottom
|
// Target is outside the view from the bottom
|
||||||
if(target.offsetTop - container.scrollTop - container.offsetTop - container.clientHeight + target.clientHeight > 0) {
|
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.
|
// The bottom of the target will be aligned to the bottom of the visible area of the scrollable ancestor.
|
||||||
target.scrollIntoView(false);
|
target.scrollIntoView(false);
|
||||||
// Do not scroll horizontally
|
|
||||||
container.scrollLeft = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user