Fossil SCM
diff.js: instead of polling for window size changes every 100ms, listen for window resize events.
Commit
c5f8e79990678c43234c8fdb82cb78e01fb9d8e9a1c008cf248a19571c98f64f
Parent
cf4b9fbd9c9cbb5…
1 file changed
+1
-1
+1
-1
| --- src/diff.js | ||
| +++ src/diff.js | ||
| @@ -61,9 +61,9 @@ | ||
| 61 | 61 | for(let i=0; i<allDiffs.length; i++){ |
| 62 | 62 | allDiffs[i].style.width = '98%'; // setting to w causes unsightly horiz. scrollbar |
| 63 | 63 | allDiffs[i].style.maxWidth = w + "px"; |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | - setTimeout(checkWidth, 100) | |
| 67 | 66 | } |
| 68 | 67 | checkWidth(); |
| 68 | + window.addEventListener('resize', checkWidth); | |
| 69 | 69 | })(); |
| 70 | 70 |
| --- src/diff.js | |
| +++ src/diff.js | |
| @@ -61,9 +61,9 @@ | |
| 61 | for(let i=0; i<allDiffs.length; i++){ |
| 62 | allDiffs[i].style.width = '98%'; // setting to w causes unsightly horiz. scrollbar |
| 63 | allDiffs[i].style.maxWidth = w + "px"; |
| 64 | } |
| 65 | } |
| 66 | setTimeout(checkWidth, 100) |
| 67 | } |
| 68 | checkWidth(); |
| 69 | })(); |
| 70 |
| --- src/diff.js | |
| +++ src/diff.js | |
| @@ -61,9 +61,9 @@ | |
| 61 | for(let i=0; i<allDiffs.length; i++){ |
| 62 | allDiffs[i].style.width = '98%'; // setting to w causes unsightly horiz. scrollbar |
| 63 | allDiffs[i].style.maxWidth = w + "px"; |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | checkWidth(); |
| 68 | window.addEventListener('resize', checkWidth); |
| 69 | })(); |
| 70 |