futurepress / epubjs-reader

Epub.js Reader
MIT License
446 stars 131 forks source link

Bookmarks not listing correct location #15

Open bgoldowsky opened 6 years ago

bgoldowsky commented 6 years ago

Just tried out the demo site, noticed this.

  1. In Chrome incognito window, visit http://futurepress.github.com/epubjs-reader/
  2. In TOC sidebar, click on "Chapter 43. Hark!" to navigate there.
  3. Close sidebar, click Bookmark icon
  4. Re-open sidebar to the bookmarks view. The bookmark list now has an entry saying "Chapter 45. The Affidavit." but it presumably ought to display "Chapter 43. Hark!"
coler-j commented 6 years ago

@bgoldowsky did you investigate what was causing this, and did you resolve it? If so, can you share a code snippet?

CatalinCernea commented 4 years ago

I saw the same issue on every epub reader here from futurepress...There's a difference of 2 on the index every time you add a bookmark. It seems that only the label added to the bookmark lists is wrong becouse if you click the bookmark it goes to the exact position..Can it be solved?

CatalinCernea commented 4 years ago

adding -2 when retrieving the tocitem solved for me for the moment.. bookmark_controller tocItem = book.navigation.toc[spineItem.index-2];