Fossil SCM

Web SBS diff: Was incorrectly using the scrollWidths of the div containers rather than that of the pre elements themselves.

joel 2013-07-16 16:02 UTC sbsreloaded
Commit 325ed34e4549e9a6331969c0a71ac13bc83988e6
1 file changed +3 -2
+3 -2
--- src/info.c
+++ src/info.c
@@ -397,13 +397,14 @@
397397
if( !sideBySide ) return;
398398
@ <script>(function(){
399399
@ var SCROLL_LEN = 25;
400400
@ function initSbsDiff(diff){
401401
@ var txtCols = diff.querySelectorAll('.difftxtcol');
402
- @ var width = Math.max(txtCols[0].scrollWidth, txtCols[1].scrollWidth);
402
+ @ var txtPres = diff.querySelectorAll('.difftxtcol pre');
403
+ @ var width = Math.max(txtPres[0].scrollWidth, txtPres[1].scrollWidth);
403404
@ for(var i=0; i<2; i++){
404
- @ txtCols[i].children[0].style.width = width + 'px';
405
+ @ txtPres[i].style.width = width + 'px';
405406
@ txtCols[i].onscroll = function(e){
406407
@ txtCols[0].scrollLeft = txtCols[1].scrollLeft = this.scrollLeft;
407408
@ };
408409
@ }
409410
@ diff.tabIndex = 0;
410411
--- src/info.c
+++ src/info.c
@@ -397,13 +397,14 @@
397 if( !sideBySide ) return;
398 @ <script>(function(){
399 @ var SCROLL_LEN = 25;
400 @ function initSbsDiff(diff){
401 @ var txtCols = diff.querySelectorAll('.difftxtcol');
402 @ var width = Math.max(txtCols[0].scrollWidth, txtCols[1].scrollWidth);
 
403 @ for(var i=0; i<2; i++){
404 @ txtCols[i].children[0].style.width = width + 'px';
405 @ txtCols[i].onscroll = function(e){
406 @ txtCols[0].scrollLeft = txtCols[1].scrollLeft = this.scrollLeft;
407 @ };
408 @ }
409 @ diff.tabIndex = 0;
410
--- src/info.c
+++ src/info.c
@@ -397,13 +397,14 @@
397 if( !sideBySide ) return;
398 @ <script>(function(){
399 @ var SCROLL_LEN = 25;
400 @ function initSbsDiff(diff){
401 @ var txtCols = diff.querySelectorAll('.difftxtcol');
402 @ var txtPres = diff.querySelectorAll('.difftxtcol pre');
403 @ var width = Math.max(txtPres[0].scrollWidth, txtPres[1].scrollWidth);
404 @ for(var i=0; i<2; i++){
405 @ txtPres[i].style.width = width + 'px';
406 @ txtCols[i].onscroll = function(e){
407 @ txtCols[0].scrollLeft = txtCols[1].scrollLeft = this.scrollLeft;
408 @ };
409 @ }
410 @ diff.tabIndex = 0;
411

Keyboard Shortcuts

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