Skip to content

Commit

Permalink
[VarDumper] Fixed search bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ro0NL committed Jan 25, 2019
1 parent cd4b031 commit f157564
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php
Expand Up @@ -500,12 +500,16 @@ function xpathHasClass(className) {
function showCurrent(state)
{
var currentNode = state.current();
var currentNode = state.current(), searchRect;
if (currentNode) {
reveal(currentNode);
highlight(root, currentNode, state.nodes);
if ('scrollIntoView' in currentNode) {
currentNode.scrollIntoView();
if (0 === currentNode.getBoundingClientRect().top) {
searchRect = search.getBoundingClientRect();
window.scrollBy(0, -(searchRect.height + searchRect.top + 5));
}
}
}
counter.textContent = (state.isEmpty() ? 0 : state.idx + 1) + ' of ' + state.count();
Expand Down Expand Up @@ -709,14 +713,16 @@ function showCurrent(state)
border-radius: 3px;
}
pre.sf-dump .sf-dump-search-hidden {
display: none;
display: none !important;
}
pre.sf-dump .sf-dump-search-wrapper {
float: right;
font-size: 0;
white-space: nowrap;
max-width: 100%;
text-align: right;
margin-bottom: 5px;
display: flex;
position: -webkit-sticky;
position: sticky;
top: 5px;
}
pre.sf-dump .sf-dump-search-wrapper > * {
vertical-align: top;
Expand All @@ -733,10 +739,11 @@ function showCurrent(state)
height: 21px;
font-size: 12px;
border-right: none;
width: 140px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
color: #000;
min-width: 15px;
width: 100%;
}
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-next,
pre.sf-dump .sf-dump-search-wrapper > .sf-dump-search-input-previous {
Expand Down

0 comments on commit f157564

Please sign in to comment.