andreask7 / lwt

Learning with Texts (LWT) is a tool for Language Learning. The official version (not this one) is available at :
http://lwt.sf.net
Other
33 stars 7 forks source link

Text position not remembered #29

Open shaund opened 6 years ago

shaund commented 6 years ago

The audio position is remembered, but not the text. Is there something I have to do to get it to save?

shaund commented 6 years ago

I made a fix. The position was being stored in the database, but the function used to scroll wasn't working. I switched to window.scrollTo instead of the 3rd-party $(document).scrollTo.

I changed line 115 (116 for https://github.com/pirtleshell/lwt) in https://github.com/andreask7/lwt/blob/7cab202b879dd81e16604c41ac5b122df803a70c/do_text_text.php#L115 to

window.scrollTo(0, $(pos[0]).position().top);

Seems to work so far.