14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
var txtPres = diff.querySelectorAll('td.difftxt pre');
var width = Math.max(txtPres[0].scrollWidth, txtPres[1].scrollWidth);
var i;
for(i=0; i<txtCols.length; i++){
txtCols[i].style.width = width + 'px';
txtPres[i].style.maxWidth = width + 'px';
txtPres[i].style.width = width + 'px';
txtCols[i].onscroll = function(e){
txtCols[0].scrollLeft = txtCols[1].scrollLeft = this.scrollLeft;
};
}
diff.tabIndex = 0;
diff.onkeydown = function(e){
e = e || event;
var len = {37: -SCROLL_LEN, 39: SCROLL_LEN}[e.keyCode];
if( !len ) return;
|
|
|
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
var txtPres = diff.querySelectorAll('td.difftxt pre');
var width = Math.max(txtPres[0].scrollWidth, txtPres[1].scrollWidth);
var i;
for(i=0; i<txtCols.length; i++){
txtCols[i].style.width = width + 'px';
txtPres[i].style.maxWidth = width + 'px';
txtPres[i].style.width = width + 'px';
txtPres[i].onscroll = function(e){
txtPres[0].scrollLeft = txtPres[1].scrollLeft = this.scrollLeft;
};
}
diff.tabIndex = 0;
diff.onkeydown = function(e){
e = e || event;
var len = {37: -SCROLL_LEN, 39: SCROLL_LEN}[e.keyCode];
if( !len ) return;
|