jquery.tocify.js icon indicating copy to clipboard operation
jquery.tocify.js copied to clipboard

Item becomes active too early

Open pozitron57 opened this issue 10 years ago • 5 comments

Hi there,

First of all, thank you for tocify!

I have an issue: if one header is far from the other, the entry becomes active too early when you scroll down. You can see it on the test page. Just scroll down.

Is it intended behavior or I messed something up? I tried setting different values for highlightOffset with no luck.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

pozitron57 avatar Oct 29 '15 00:10 pozitron57

Grab _jquery.tocify.js from lord/slate repo, file contains a fix

alexey-yanchenko avatar Nov 30 '16 08:11 alexey-yanchenko

@alexey-yanchenko the link to _jquery.tocify.js 404s. I'm also suffering from this bug, do you happen to know what the fix was? Or even, know what version of lord/slate your fix was in? It looks like version 1.4 almost lines up with date to your comment here. I'll start there.

I'd like to post a PR here so everyone can benefit from having this fix in TOC itself.

jenlampton avatar Jun 17 '19 18:06 jenlampton

I haven't had time to maintain this repository for the last few years, so if anyone would like a particular fix just send me a tip via Paypal and I'll look into it

gfranko avatar Jun 17 '19 18:06 gfranko

Thanks @gfranko, it's a cool little lib, and thanks for all your work on it in the past! :)

jenlampton avatar Jun 17 '19 18:06 jenlampton

Okay, I took version 1.4 of lord/slate and made a diff between _jquery.tocify.js and version 1.8 of jquery.tocify.js. I then applied that diff to the 1.9 version of jquery.tocify.js and created a pr: https://github.com/gfranko/jquery.tocify.js/pull/112

I'm not very good with JavaScript, so I didn't try to pick out only the changes that I thought were relevant to this issue, but I can confirm that the item becoming active too early is no longer an issue on my site.

jenlampton avatar Jun 20 '19 01:06 jenlampton