Artifact c0bbb2dfdab153501587d89560acf7008e03bb2932c4de86437d2bc14c3bec9e:
- File src/forum.js — part of check-in [9ea4805e5c] at 2018-07-26 10:50:51 on branch forum-v2 — Add the missing forum.js file. Adjust forum.js so that it does a better job of autoscrolling to the selected forum message. (user: drh size: 440)
(function(){ function absoluteY(obj){ var top = 0; if( obj.offsetParent ){ do{ top += obj.offsetTop; }while( obj = obj.offsetParent ); } return top; } var x = document.getElementsByClassName('forumSel'); if(x[0]){ var w = window.innerHeight; var h = x[0].scrollHeight; var y = absoluteY(x[0]); if( w<h ){ y = y + (h-w)/2; } if( y>0 ) window.scrollTo(0, y); } }())