fix(playground): scroll with vanilla JS
jQuery must burn in fire.
This commit is contained in:
parent
99c121bfe8
commit
0bb43f7afb
2 changed files with 5 additions and 8 deletions
|
|
@ -83,9 +83,6 @@
|
|||
</main>
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous">
|
||||
</script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.19.0/clusterize.min.js"></script>
|
||||
|
||||
|
|
|
|||
|
|
@ -487,12 +487,12 @@ window.initializePlayground = async (opts) => {
|
|||
const containerHeight = outputContainerScroll.clientHeight;
|
||||
const offset = treeRowHighlightedIndex * lineHeight;
|
||||
if (scrollTop > offset - 20) {
|
||||
$(outputContainerScroll).animate({ scrollTop: offset - 20 }, 150);
|
||||
outputContainerScroll.scrollTo({ top: offset - 20, behavior: 'smooth' });
|
||||
} else if (scrollTop < offset + lineHeight + 40 - containerHeight) {
|
||||
$(outputContainerScroll).animate(
|
||||
{ scrollTop: offset - containerHeight + 40 },
|
||||
150,
|
||||
);
|
||||
outputContainerScroll.scrollTo({
|
||||
top: offset - containerHeight + 40,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue