Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0cd51ae

Browse files
committed
[Profiler] Fix dump makes toolbar disappear
1 parent c3d4536 commit 0cd51ae

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,10 @@
418418
'{{ path("_wdt", { "token": "xxxxxx" }) }}'.replace(/xxxxxx/, newToken),
419419
function(xhr, el) {
420420
421-
/* Evaluate embedded scripts inside the toolbar */
422-
var i, scripts = [].slice.call(el.querySelectorAll('script'));
423-
424-
for (i = 0; i < scripts.length; ++i) {
425-
eval(scripts[i].firstChild.nodeValue);
426-
}
421+
/* Evaluate in global scope scripts embedded inside the toolbar */
422+
eval.call({}, ([].slice.call(el.querySelectorAll('script')).map(function (script) {
423+
return script.firstChild.nodeValue;
424+
}).join('\n')));
427425
428426
el.style.display = -1 !== xhr.responseText.indexOf('sf-toolbarreset') ? 'block' : 'none';
429427
@@ -442,7 +440,7 @@
442440
}
443441
444442
/* Handle toolbar-info position */
445-
var toolbarBlocks = [].slice.call(el.querySelectorAll('.sf-toolbar-block'));
443+
var i, toolbarBlocks = [].slice.call(el.querySelectorAll('.sf-toolbar-block'));
446444
for (i = 0; i < toolbarBlocks.length; ++i) {
447445
toolbarBlocks[i].onmouseover = function () {
448446
var toolbarInfo = this.querySelectorAll('.sf-toolbar-info')[0];

0 commit comments

Comments
 (0)