Fossil SCM
Simplify the loop to enumerate table columns to the left.
Commit
faadb48dc9e74255c21fe4bf27bb86e6e4f5406aad204f1a488bddfe0d8ab82c
Parent
dbffb2fad2e2a3a…
1 file changed
+1
-4
+1
-4
| --- src/fossil.diff.js | ||
| +++ src/fossil.diff.js | ||
| @@ -672,14 +672,11 @@ | ||
| 672 | 672 | f.colsU = document.querySelectorAll('td.difftxtu pre'); |
| 673 | 673 | } |
| 674 | 674 | f.colsU.forEach(function(e){ |
| 675 | 675 | w = lastWidth - 3; // Outer border |
| 676 | 676 | var k = e.parentElement/*TD*/; |
| 677 | - for(var i=0;i<3;i++){ | |
| 678 | - k = k.previousElementSibling/*TD*/; | |
| 679 | - w -= k.scrollWidth; | |
| 680 | - } | |
| 677 | + while(k = k.previousElementSibling/*TD*/) w -= k.scrollWidth; | |
| 681 | 678 | e.style.width = w + "px"; |
| 682 | 679 | e.style.maxWidth = w + "px"; |
| 683 | 680 | }); |
| 684 | 681 | if(0){ // seems to be unnecessary |
| 685 | 682 | if(!f.allDiffs){ |
| 686 | 683 |
| --- src/fossil.diff.js | |
| +++ src/fossil.diff.js | |
| @@ -672,14 +672,11 @@ | |
| 672 | f.colsU = document.querySelectorAll('td.difftxtu pre'); |
| 673 | } |
| 674 | f.colsU.forEach(function(e){ |
| 675 | w = lastWidth - 3; // Outer border |
| 676 | var k = e.parentElement/*TD*/; |
| 677 | for(var i=0;i<3;i++){ |
| 678 | k = k.previousElementSibling/*TD*/; |
| 679 | w -= k.scrollWidth; |
| 680 | } |
| 681 | e.style.width = w + "px"; |
| 682 | e.style.maxWidth = w + "px"; |
| 683 | }); |
| 684 | if(0){ // seems to be unnecessary |
| 685 | if(!f.allDiffs){ |
| 686 |
| --- src/fossil.diff.js | |
| +++ src/fossil.diff.js | |
| @@ -672,14 +672,11 @@ | |
| 672 | f.colsU = document.querySelectorAll('td.difftxtu pre'); |
| 673 | } |
| 674 | f.colsU.forEach(function(e){ |
| 675 | w = lastWidth - 3; // Outer border |
| 676 | var k = e.parentElement/*TD*/; |
| 677 | while(k = k.previousElementSibling/*TD*/) w -= k.scrollWidth; |
| 678 | e.style.width = w + "px"; |
| 679 | e.style.maxWidth = w + "px"; |
| 680 | }); |
| 681 | if(0){ // seems to be unnecessary |
| 682 | if(!f.allDiffs){ |
| 683 |