File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
TwigBundle/Resources/views
WebProfilerBundle/Resources/views Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 4545 var tabNavigation = document .createElement (' ul' );
4646 tabNavigation .className = ' tab-navigation' ;
4747
48+ var selectedTabId = ' tab-' + i + ' -0' ; /* select the first tab by default */
4849 for (var j = 0 ; j < tabs .length ; j++ ) {
4950 var tabId = ' tab-' + i + ' -' + j;
5051 var tabTitle = tabs[j].querySelector (' .tab-title' ).innerHTML ;
5152
5253 var tabNavigationItem = document .createElement (' li' );
5354 tabNavigationItem .setAttribute (' data-tab-id' , tabId);
54- if (j == 0 ) { addClass (tabNavigationItem , ' active' ); }
55+ if (hasClass (tabs[j] , ' active' )) { selectedTabId = tabId ; }
5556 if (hasClass (tabs[j], ' disabled' )) { addClass (tabNavigationItem, ' disabled' ); }
5657 tabNavigationItem .innerHTML = tabTitle;
5758 tabNavigation .appendChild (tabNavigationItem);
6162 }
6263
6364 tabGroups[i].insertBefore (tabNavigation, tabGroups[i].firstChild );
65+ addClass (document .querySelector (' [data-tab-id="' + selectedTabId + ' "]' ), ' active' );
6466 }
6567
6668 /* display the active tab and add the 'click' event listeners */
Original file line number Diff line number Diff line change 117117 {% endfor %}
118118
119119 <div class =" sf-tabs" >
120- <div class =" tab" >
120+ <div class =" tab {{ collector . countMissings == 0 ? ' active ' }} " >
121121 <h3 class =" tab-title" >Defined <span class =" badge" >{{ collector .countDefines }}</span ></h3 >
122122
123123 <div class =" tab-content" >
158158 </div >
159159 </div >
160160
161- <div class =" tab" >
161+ <div class =" tab {{ collector . countMissings > 0 ? ' active ' }} " >
162162 <h3 class =" tab-title" >Missing <span class =" badge {{ collector .countMissings ? ' status-error' }}" >{{ collector .countMissings }}</span ></h3 >
163163
164164 <div class =" tab-content" >
Original file line number Diff line number Diff line change 406406 var tabNavigation = document .createElement (' ul' );
407407 tabNavigation .className = ' tab-navigation' ;
408408
409+ var selectedTabId = ' tab-' + i + ' -0' ; /* select the first tab by default */
409410 for (var j = 0 ; j < tabs .length ; j++ ) {
410411 var tabId = ' tab-' + i + ' -' + j;
411412 var tabTitle = tabs[j].querySelector (' .tab-title' ).innerHTML ;
412413
413414 var tabNavigationItem = document .createElement (' li' );
414415 tabNavigationItem .setAttribute (' data-tab-id' , tabId);
415- if (j == 0 ) { addClass (tabNavigationItem , ' active' ); }
416+ if (hasClass (tabs[j] , ' active' )) { selectedTabId = tabId ; }
416417 if (hasClass (tabs[j], ' disabled' )) { addClass (tabNavigationItem, ' disabled' ); }
417418 tabNavigationItem .innerHTML = tabTitle;
418419 tabNavigation .appendChild (tabNavigationItem);
422423 }
423424
424425 tabGroups[i].insertBefore (tabNavigation, tabGroups[i].firstChild );
426+ addClass (document .querySelector (' [data-tab-id="' + selectedTabId + ' "]' ), ' active' );
425427 }
426428
427429 /* display the active tab and add the 'click' event listeners */
You can’t perform that action at this time.
0 commit comments