JonJagger/cyberdojo — pull request #25 by michelgrootjans (2013-05-29 11:45:41+00:00)
Title: Auto-scroll to first red/green lines in diff-view

The autoscroll to first red/green seems to be working now. At least in my configuration: Safari, FireFox and Chrome on Mountain Lion. Can you confirm it works on yours?

The scrolling after clicking on the filename seems to be giving unconsistent results though. Could someone explain the mechanics behind this logic:
```scrollTop: section.offset().top - diffSheet.offset().top - downFromTop ```
*/app/assets/javascripts/cyber-dojo_build_diff_filenames.js:34*

I found a similar implementation [on SO](http://stackoverflow.com/questions/2905867/how-to-scroll-to-specific-item-using-jquery), but I don't understand it:
```
container.scrollTop(
scrollTo.offset().top - container.offset().top + container.scrollTop()
);
```