Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 084cca6

Browse files
committed
Minor JavaScript optimizations
1 parent 972a92e commit 084cca6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@
169169
infoSpan.textContent = text;
170170
}
171171
} else {
172-
var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax');
173-
ajaxToolbarPanel[0].style.display = 'none';
172+
var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');
173+
ajaxToolbarPanel.style.display = 'none';
174174
}
175175
}
176176
@@ -179,11 +179,11 @@
179179
var className = 'sf-toolbar-ajax-requests sf-toolbar-value';
180180
requestCounter[0].className = className;
181181
182-
var ajaxToolbarPanel = document.querySelectorAll('.sf-toolbar-block-ajax');
182+
var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');
183183
if (state == 'error') {
184-
Sfjs.addClass(ajaxToolbarPanel[0], 'sf-toolbar-status-red');
184+
Sfjs.addClass(ajaxToolbarPanel, 'sf-toolbar-status-red');
185185
} else {
186-
Sfjs.addClass(ajaxToolbarPanel[0], 'sf-ajax-request-loading');
186+
Sfjs.addClass(ajaxToolbarPanel, 'sf-ajax-request-loading');
187187
}
188188
};
189189

0 commit comments

Comments
 (0)