10000 [WebProfilerBundle] Append new ajax request to the end of the list · symfony/symfony@45d4559 · GitHub
[go: up one dir, main page]

Skip to content

Commit 45d4559

Browse files
BoShurikfabpot
authored andcommitted
[WebProfilerBundle] Append new ajax request to the end of the list
1 parent 83232f8 commit 45d4559

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
129129
var nbOfAjaxRequest = tbody.rows.length;
130130
if (nbOfAjaxRequest >= 100) {
131-
tbody.deleteRow(nbOfAjaxRequest - 1);
131+
tbody.deleteRow(0);
132132
}
133133
134134
var request = requestStack[index];
@@ -177,7 +177,10 @@
177177
}, 100);
178178
179179
row.className = 'sf-ajax-request sf-ajax-request-loading';
180-
tbody.insertBefore(row, tbody.firstChild);
180+
tbody.insertBefore(row, null);
181+
182+
var toolbarInfo = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
183+
toolbarInfo.scrollTop = toolbarInfo.scrollHeight;
181184
182185
renderAjaxRequests();
183186
};
@@ -492,6 +495,10 @@
492495
setPreference('toolbar/displayState', 'block');
493496
});
494497
renderAjaxRequests();
498+
addEventListener(document.querySelector('.sf-toolbar-block-ajax'), 'mouseenter', function (event) {
499+
var elem = document.querySelector('.sf-toolbar-block-ajax .sf-toolbar-info');
500+
elem.scrollTop = elem.scrollHeight;
501+
});
495502
addEventListener(document.querySelector('.sf-toolbar-block-ajax > .sf-toolbar-icon'), 'click', function (event) {
496503
event.preventDefault();
497504

0 commit comments

Comments
 (0)
0