File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
class SymfonyProfiler {
13
13
constructor () {
14
+ this .#reorderMainMenuItems ();
14
15
this .#createTabs ();
15
16
this .#createTableSearchFields ();
16
17
this .#createToggles ();
17
18
this .#createCopyToClipboard ();
18
19
this .#convertDateTimesToUserTimezone ();
19
20
}
20
21
22
+ #reorderMainMenuItems () {
23
+ /* reorder the main menu items to always display first the non-disabled items */
24
+ const mainMenuElement = document .querySelector (' #menu-profiler' );
25
+ const firstDisabledMenuItem = mainMenuElement .querySelector (' li a > span.disabled' )? .parentNode ? .parentNode ;
26
+
27
+ if (! firstDisabledMenuItem) {
28
+ return ;
29
+ }
30
+
31
+ const mainMenuItems = mainMenuElement .querySelectorAll (' li' );
32
+ mainMenuItems .forEach (menuItem => {
33
+ const isDisabled = null !== menuItem .querySelector (' a > span.disabled' );
34
+ if (! isDisabled) {
35
+ mainMenuElement .insertBefore (menuItem, firstDisabledMenuItem);
36
+ }
37
+ });
38
+ }
39
+
21
40
#createTabs () {
22
41
/* the accessibility options of this component have been defined according to: */
23
42
/* www.w3.org/WAI/ARIA/apg/example-index/tabs/tabs-manual.html */
You can’t perform that action at this time.
0 commit comments