Fossil SCM

Reverted a recent modernization in sbsdiff.js because the MSIE<=11 family of browsers do not support NodeList.forEach.

stephan 2020-08-08 12:11 trunk
Commit 7f416ef1754dc7158e39709fda75766719579f7d9b7ea2e6af4f6f6f99d2874f
1 file changed +9 -1
+9 -1
--- src/sbsdiff.js
+++ src/sbsdiff.js
@@ -22,12 +22,20 @@
2222
if( !len ) return;
2323
txtCols[0].scrollLeft += len;
2424
return false;
2525
};
2626
}
27
- document.querySelectorAll('.sbsdiffcols').forEach(initSbsDiff);
27
+ var i, diffs = document.querySelectorAll('.sbsdiffcols')
28
+ /* Maintenance reminder: using forEach() here breaks
29
+ MSIE<=11, and we need to keep those browsers working on
30
+ the /info page. */;
31
+ for(i=0; i<diffs.length; i++){
32
+ initSbsDiff(diffs[i]);
33
+ }
2834
if(window.fossil && fossil.page){
35
+ /* Here we can use forEach() because the pages which use
36
+ fossil.pages only work in HTML5-compliant browsers. */
2937
fossil.page.tweakSbsDiffs = function(){
3038
document.querySelectorAll('.sbsdiffcols').forEach(initSbsDiff);
3139
};
3240
}
3341
})();
3442
--- src/sbsdiff.js
+++ src/sbsdiff.js
@@ -22,12 +22,20 @@
22 if( !len ) return;
23 txtCols[0].scrollLeft += len;
24 return false;
25 };
26 }
27 document.querySelectorAll('.sbsdiffcols').forEach(initSbsDiff);
 
 
 
 
 
 
28 if(window.fossil && fossil.page){
 
 
29 fossil.page.tweakSbsDiffs = function(){
30 document.querySelectorAll('.sbsdiffcols').forEach(initSbsDiff);
31 };
32 }
33 })();
34
--- src/sbsdiff.js
+++ src/sbsdiff.js
@@ -22,12 +22,20 @@
22 if( !len ) return;
23 txtCols[0].scrollLeft += len;
24 return false;
25 };
26 }
27 var i, diffs = document.querySelectorAll('.sbsdiffcols')
28 /* Maintenance reminder: using forEach() here breaks
29 MSIE<=11, and we need to keep those browsers working on
30 the /info page. */;
31 for(i=0; i<diffs.length; i++){
32 initSbsDiff(diffs[i]);
33 }
34 if(window.fossil && fossil.page){
35 /* Here we can use forEach() because the pages which use
36 fossil.pages only work in HTML5-compliant browsers. */
37 fossil.page.tweakSbsDiffs = function(){
38 document.querySelectorAll('.sbsdiffcols').forEach(initSbsDiff);
39 };
40 }
41 })();
42

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button