Skip to content

Commit

Permalink
feature #27763 [WebProfilerBundle] Append new ajax request to the end…
Browse files Browse the repository at this point in the history
… of the list (BoShurik)

This PR was squashed before being merged into the 4.2-dev branch (closes #27763).

Discussion
----------

[WebProfilerBundle] Append new ajax request to the end of the list

Append new ajax request to the end of the list instead of adding it to the beginning

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes/no
| BC breaks?    | no/yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Didn't find why this behavior was changed with web profiler design.
In current version it is hard to click to the latest ajax request.

Commits
-------

45d4559 [WebProfilerBundle] Append new ajax request to the end of the list
  • Loading branch information
fabpot committed Aug 2, 2018
2 parents 924f7f9 + 45d4559 commit 6198223
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -128,7 +128,7 @@
var nbOfAjaxRequest = tbody.rows.length;
if (nbOfAjaxRequest >= 100) {
tbody.deleteRow(nbOfAjaxRequest - 1);
tbody.deleteRow(0);
}
var request = requestStack[index];
Expand Down Expand Up @@ -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();
};
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 6198223

Please sign in to comment.