File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,28 @@ function linkifyRow(tr) {
3636function linkifyAll ( ) {
3737 document . querySelectorAll ( 'tr.region' ) . forEach ( linkifyRow ) ;
3838}
39+ const PREVENT_FILTER_TOTAL = true ;
40+ function preventUpdateTotalCell ( cell ) {
41+ let target = cell . classList ;
42+ let oldContains = target . contains . bind ( target ) ;
43+ function newContains ( value ) {
44+ // Tell the Coverage.py code that all entries in total row are 'name'
45+ // so it doesn't try to modify them.
46+ if ( value == "name" ) return true ;
47+ return oldContains ( value ) ;
48+ }
49+ target . contains = newContains ;
50+ }
51+ function preventUpdateTotal ( ) {
52+ [ ...document . querySelector ( 'table.index' ) . tFoot . rows [ 0 ] . cells ]
53+ . forEach ( preventUpdateTotalCell ) ;
54+ }
3955addEventListener ( 'load' , ( ) => {
4056 if ( document . body . classList . contains ( "indexfile" ) ) {
4157 setColors ( ) ;
4258 linkifyAll ( ) ;
59+ if ( PREVENT_FILTER_TOTAL ) {
60+ preventUpdateTotal ( ) ;
61+ }
4362 }
4463} ) ;
You can’t perform that action at this time.
0 commit comments