|
943 | 943 | var data = JSON.parse(dataEl.textContent); |
944 | 944 | var container = document.querySelector('.functions-body'); |
945 | 945 | var loadingEl = document.getElementById('functions-loading'); |
| 946 | + var showBranches = config.showBranches; |
946 | 947 | var showConditions = config.showConditions; |
947 | 948 | var singlePage = config.singlePage; |
948 | 949 | var currentFile = config.htmlFilename || ''; |
|
1013 | 1014 | // col-lines |
1014 | 1015 | row.appendChild(el('div', 'col-lines', entry.line_coverage + '%')); |
1015 | 1016 |
|
| 1017 | + // col-branches (optional) |
| 1018 | + if (showBranches) { |
| 1019 | + row.appendChild(el('div', 'col-branches', entry.branch_coverage + '%')); |
| 1020 | + } |
| 1021 | + |
1016 | 1022 | // col-conditions (optional) |
1017 | 1023 | if (showConditions) { |
1018 | 1024 | row.appendChild(el('div', 'col-conditions', entry.condition_coverage + '%')); |
|
1085 | 1091 | case 'name': aVal = a.name; bVal = b.name; break; |
1086 | 1092 | case 'calls': aVal = a.excluded ? -1 : a.execution_count; bVal = b.excluded ? -1 : b.execution_count; break; |
1087 | 1093 | case 'lines': aVal = parseFloat(a.line_coverage) || 0; bVal = parseFloat(b.line_coverage) || 0; break; |
| 1094 | + case 'branches': aVal = parseFloat(a.branch_coverage) || 0; bVal = parseFloat(b.branch_coverage) || 0; break; |
1088 | 1095 | case 'conditions': aVal = parseFloat(a.condition_coverage) || 0; bVal = parseFloat(b.condition_coverage) || 0; break; |
1089 | 1096 | default: aVal = a.name; bVal = b.name; |
1090 | 1097 | } |
|
2043 | 2050 | } catch (e) {} |
2044 | 2051 |
|
2045 | 2052 | // Apply saved hidden columns |
| 2053 | + var fnList = document.querySelector('.source-functions-list'); |
2046 | 2054 | for (var i = 0; i < hidden.length; i++) { |
2047 | 2055 | table.classList.add('hide-col-' + hidden[i]); |
| 2056 | + if (fnList) { |
| 2057 | + fnList.classList.add('hide-col-' + hidden[i]); |
| 2058 | + } |
2048 | 2059 | } |
2049 | 2060 |
|
2050 | 2061 | // Update button appearance to match state |
|
2063 | 2074 | var isHidden = table.classList.toggle(hideClass); |
2064 | 2075 | this.classList.toggle('show-col', !isHidden); |
2065 | 2076 |
|
| 2077 | + // Sync with function list sidebar |
| 2078 | + var fnList = document.querySelector('.source-functions-list'); |
| 2079 | + if (fnList) { |
| 2080 | + fnList.classList.toggle(hideClass, isHidden); |
| 2081 | + } |
| 2082 | + |
2066 | 2083 | // Save state |
2067 | 2084 | var current = []; |
2068 | 2085 | var allBtns = document.querySelectorAll('.col-toggle'); |
|
0 commit comments