Skip to content

Commit 16c5c76

Browse files
committed
feature #19796 [VarDumper] Make the line clickable to toggle dumps (nicolas-grekas)
This PR was merged into the 3.2-dev branch. Discussion ---------- [VarDumper] Make the line clickable to toggle dumps | Q | A | ------------- | --- | Branch? | master | New feature? | yes | Tests pass? | yes | License | MIT The arrow to toggle dumps is too small. Let's make the text before it clickable. Commits ------- 2697dd5 [VarDumper] Make the line clickable to toggle dumps
2 parents 4fbf80d + 2697dd5 commit 16c5c76

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ function a(e, f) {
205205
f(e.target, e);
206206
} else if ('A' == e.target.parentNode.tagName) {
207207
f(e.target.parentNode, e);
208+
} else if (e.target.nextElementSibling && 'A' == e.target.nextElementSibling.tagName) {
209+
f(e.target.nextElementSibling, e, true);
208210
}
209211
});
210212
};
@@ -238,7 +240,7 @@ function isCtrlKey(e) {
238240
}
239241
}
240242
});
241-
a('click', function (a, e) {
243+
a('click', function (a, e, c) {
242244
if (/\bsf-dump-toggle\b/.test(a.className)) {
243245
e.preventDefault();
244246
if (!toggle(a, isCtrlKey(e))) {
@@ -259,7 +261,8 @@ function isCtrlKey(e) {
259261
}
260262
}
261263
262-
if (doc.getSelection) {
264+
if (c) {
265+
} else if (doc.getSelection) {
263266
try {
264267
doc.getSelection().removeAllRanges();
265268
} catch (e) {

0 commit comments

Comments
 (0)