File tree 3 files changed +8
-4
lines changed
TwigBundle/Resources/views
WebProfilerBundle/Resources/views 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 45
45
var tabNavigation = document .createElement (' ul' );
46
46
tabNavigation .className = ' tab-navigation' ;
47
47
48
+ var selectedTabId = ' tab-' + i + ' -0' ; /* select the first tab by default */
48
49
for (var j = 0 ; j < tabs .length ; j++ ) {
49
50
var tabId = ' tab-' + i + ' -' + j;
50
51
var tabTitle = tabs[j].querySelector (' .tab-title' ).innerHTML ;
51
52
52
53
var tabNavigationItem = document .createElement (' li' );
53
54
tabNavigationItem .setAttribute (' data-tab-id' , tabId);
54
- if (j == 0 ) { addClass (tabNavigationItem , ' active' ); }
55
+ if (hasClass (tabs[j] , ' active' )) { selectedTabId = tabId ; }
55
56
if (hasClass (tabs[j], ' disabled' )) { addClass (tabNavigationItem, ' disabled' ); }
56
57
tabNavigationItem .innerHTML = tabTitle;
57
58
tabNavigation .appendChild (tabNavigationItem);
61
62
}
62
63
63
64
tabGroups[i].insertBefore (tabNavigation, tabGroups[i].firstChild );
65
+ addClass (document .querySelector (' [data-tab-id="' + selectedTabId + ' "]' ), ' active' );
64
66
}
65
67
66
68
/* display the active tab and add the 'click' event listeners */
Original file line number Diff line number Diff line change 117
117
{% endfor %}
118
118
119
119
<div class =" sf-tabs" >
120
- <div class =" tab" >
120
+ <div class =" tab {{ collector . countMissings == 0 ? ' active ' }} " >
121
121
<h3 class =" tab-title" >Defined <span class =" badge" >{{ collector .countDefines }}</span ></h3 >
122
122
123
123
<div class =" tab-content" >
158
158
</div >
159
159
</div >
160
160
161
- <div class =" tab" >
161
+ <div class =" tab {{ collector . countMissings > 0 ? ' active ' }} " >
162
162
<h3 class =" tab-title" >Missing <span class =" badge {{ collector .countMissings ? ' status-error' }}" >{{ collector .countMissings }}</span ></h3 >
163
163
164
164
<div class =" tab-content" >
Original file line number Diff line number Diff line change 406
406
var tabNavigation = document .createElement (' ul' );
407
407
tabNavigation .className = ' tab-navigation' ;
408
408
409
+ var selectedTabId = ' tab-' + i + ' -0' ; /* select the first tab by default */
409
410
for (var j = 0 ; j < tabs .length ; j++ ) {
410
411
var tabId = ' tab-' + i + ' -
9BA4
39; + j;
411
412
var tabTitle = tabs[j].querySelector (' .tab-title' ).innerHTML ;
412
413
413
414
var tabNavigationItem = document .createElement (' li' );
414
415
tabNavigationItem .setAttribute (' data-tab-id' , tabId);
415
- if (j == 0 ) { addClass (tabNavigationItem , ' active' ); }
416
+ if (hasClass (tabs[j] , ' active' )) { selectedTabId = tabId ; }
416
417
if (hasClass (tabs[j], ' disabled' )) { addClass (tabNavigationItem, ' disabled' ); }
417
418
tabNavigationItem .innerHTML = tabTitle;
418
419
tabNavigation .appendChild (tabNavigationItem);
422
423
}
423
424
424
425
tabGroups[i].insertBefore (tabNavigation, tabGroups[i].firstChild );
426
+ addClass (document .querySelector (' [data-tab-id="' + selectedTabId + ' "]' ), ' active' );
425
427
}
426
428
427
429
/* display the active tab and add the 'click' event listeners */
You can’t perform that action at this time.
0 commit comments