definitely drop me a note before starting, so that I can finish off anything that might be pending.Jeremy Bernstein wrote:Thanks, I saw, and will (try to) merge those changes in at some point (the code bases are divergent enough [in places] at this point to make merging non-trivial -- I need to find the time and patience to deal with it...).
excellent idea. I looked at your code though I dont think that code belongs to the main js file since you are making assumptions on the placement of the moves in the page; for instance some page might not have a "headerMoves" container as defined in board.htmlJeremy Bernstein wrote:Btw, I just added some code to handle auto-scrolling of the move list (so that the move list follows the move on the board), which works well in every browser I've tested. Might be worth integrating into the trunk.
I still need to test with Internet Explorer (it's always a pain) but I think I will add this code, derived from yours, in the board.html file:
Code: Select all
function customFunctionOnMove() {
if (theContainerObject = document.getElementById("headerMoves")) {
if (CurrentPly === 0) { theContainerObject.scrollTop = 0; }
else if (theMoveObject = document.getElementById('Mv' + CurrentPly)) {
if (theMoveObject.offsetTop + theMoveObject.offsetHeight > theContainerObject.scrollTop + theContainerObject.offsetHeight) {
theContainerObject.scrollTop = theMoveObject.offsetTop + theMoveObject.offsetHeight - theContainerObject.offsetHeight;
} else if (theMoveObject.offsetTop < theContainerObject.scrollTop) {
theContainerObject.scrollTop = theMoveObject.offsetTop;
}
}
}
}