@@ -500,12 +500,17 @@ function xpathHasClass(className) {
500
500
501
501
function showCurrent(state)
502
502
{
503
- var currentNode = state.current();
503
+ var currentNode = state.current(), currentRect, searchRect ;
504
504
if (currentNode) {
505
505
reveal(currentNode);
506
506
highlight(root, currentNode, state.nodes);
507
507
if ('scrollIntoView' in currentNode) {
508
- currentNode.scrollIntoView();
508
+ currentNode.scrollIntoView(true);
509
+ currentRect = currentNode.getBoundingClientRect();
510
+ searchRect = search.getBoundingClientRect();
511
+ if (currentRect.top < (searchRect.top + searchRect.height)) {
512
+ window.scrollBy(0, -(searchRect.top + searchRect.height + 5));
513
+ }
509
514
}
510
515
}
511
516
counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' of ' + state.count();
@@ -641,6 +646,7 @@ function showCurrent(state)
641
646
display: block;
642
647
white-space: pre;
643
648
padding: 5px;
649
+ overflow: initial !important;
644
650
}
645
651
pre.sf-dump:after {
646
652
content: "";
@@ -709,14 +715,16 @@ function showCurrent(state)
709
715
border-radius: 3px;
710
716
}
711
717
pre.sf-dump .sf-dump-search-hidden {
712
- display: none;
718
+ display: none !important ;
713
719
}
714
720
pre.sf-dump .sf-dump-search-wrapper {
715
- float: right;
716
721
font-size: 0;
717
722
white-space: nowrap;
718
- max-width: 100%;
719
- text-align: right;
723
+ margin-bottom: 5px;
724
+ display: flex;
725
+ position: -webkit-sticky;
726
+ position: sticky;
727
+ top: 5px;
720
728
}
721
729
pre.sf-dump .sf-dump-search-wrapper > * {
722
730
vertical-align: top;
@@ -733,10 +741,11 @@ function showCurrent(state)
733
741
height: 21px;
734
742
font-size: 12px;
735
743
border-right: none;
736
- width: 140px;
737
744
border-top-left-radius: 3px;
738
745
border-bottom-left-radius: 3px;
739
746
color: #000;
747
+ min-width: 15px;
748
+ width: 100%;
740
749
}
741
750
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next,
742
751
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous {
0 commit comments