[TxMt] markdown_to_help.rb: tiny bug in JavaScript function goTo(id)

Hans-Joerg Bibiko bibiko at eva.mpg.de
Wed Oct 24 07:25:08 UTC 2007


Hi,

I just saw that there is a tiny bug in the JavaScript function goTo 
(id) in markdown_to_help.rb.
If you click at an item in the TOC it jumps to that anker but with a  
wrong offset, meaning the beginning of the anker is hidden caused by  
the TextMate header image.

To solve that problem easily I would suggest to do the following if  
one predicts that the first image in the html source code is  
"header.png":

markdown_to_help.rb:

old:
68: function goTo (id) {
69:   document.body.scrollTop = document.getElementById(id).offsetTop  
+ 8;
70: }


new:
old:
68: function goTo (id) {
69:   document.body.scrollTop = document.getElementById(id).offsetTop  
- document.images[0].height - 1;
70: }


Cheers,

--Hans



More information about the textmate mailing list