Skip to content

Commit a1863c3

Browse files
committed
[VarDumper] HtmlDumper: fix collapsing nodes with depth <= maxDepth
1 parent 98dae3e commit a1863c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,9 @@ function xpathString(str) {
383383
x += elt.parentNode.getAttribute('data-depth')/1;
384384
}
385385
elt.setAttribute('data-depth', x);
386-
if (elt.className ? 'sf-dump-expanded' !== elt.className : (x > options.maxDepth)) {
387-
elt.className = 'sf-dump-expanded';
386+
var className = elt.className;
387+
elt.className = 'sf-dump-expanded';
388+
if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) {
388389
toggle(a);
389390
}
390391
} else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {

0 commit comments

Comments
 (0)