bug #33575 [WebProfilerBundle] Fix time panel legend buttons (fancyweb)

This PR was merged into the 4.3 branch.

Discussion
----------

[WebProfilerBundle] Fix time panel legend buttons

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/33536
| License       | MIT
| Doc PR        | -

It fixes the buttons multiple generations and the toggle behavior as well.

Commits
-------

7f4c8d3271 [WebProfilerBundle] Fix time panel legend buttons
This commit is contained in:
Fabien Potencier 2019-09-15 10:39:57 +02:00
commit 1a9c6338f3

View File

@ -220,7 +220,9 @@ class Legend {
this.toggle = this.toggle.bind(this);
this.createCategory = this.createCategory.bind(this);
this.categories = Array.from(Object.keys(classnames)).map(this.createCategory);
this.categories = [];
Object.keys(classnames).forEach(this.createCategory);
}
add(category) {
@ -238,6 +240,8 @@ class Legend {
this.element.appendChild(element);
this.categories.push(element);
return element;
}