From 45d4559ab256924633aa2da7e0f0237ebcc7c852 Mon Sep 17 00:00:00 2001 From: BoShurik Date: Thu, 28 Jun 2018 18:58:39 +0300 Subject: [PATCH] [WebProfilerBundle] Append new ajax request to the end of the list --- .../Resources/views/Profiler/base_js.html.twig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index fb266c554bf9..90049054e993 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -128,7 +128,7 @@ var nbOfAjaxRequest = tbody.rows.length; if (nbOfAjaxRequest >= 100) { - tbody.deleteRow(nbOfAjaxRequest - 1); + tbody.deleteRow(0); } var request = requestStack[index]; @@ -177,7 +177,10 @@ }, 100); row.className = 'sf-ajax-request sf-ajax-request-loading'; - tbody.insertBefore(row, tbody.firstChild); + tbody.insertBefore(row, null); + + var toolbarInfo = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info'); + toolbarInfo.scrollTop = toolbarInfo.scrollHeight; renderAjaxRequests(); }; @@ -492,6 +495,10 @@ setPreference('toolbar/displayState', 'block'); }); renderAjaxRequests(); + addEventListener(document.querySelector('.sf-toolbar-block-ajax'), 'mouseenter', function (event) { + var elem = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info'); + elem.scrollTop = elem.scrollHeight; + }); addEventListener(document.querySelector('.sf-toolbar-block-ajax > .sf-toolbar-icon'), 'click', function (event) { event.preventDefault();