mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
remove boomark, handle goto and gotoCfi before render
This commit is contained in:
parent
c17e707ec4
commit
4e129111b4
10 changed files with 113 additions and 36 deletions
|
@ -47,9 +47,21 @@ EPUBJS.reader.ControlsController = function(book) {
|
|||
});
|
||||
|
||||
$bookmark.on("click", function() {
|
||||
$bookmark.addClass("icon-bookmark");
|
||||
$bookmark.removeClass("icon-bookmark-empty");
|
||||
reader.addBookmark(reader.book.getCurrentLocationCfi());
|
||||
var cfi = reader.book.getCurrentLocationCfi();
|
||||
var bookmarked = reader.isBookmarked(cfi);
|
||||
|
||||
if(bookmarked === -1) { //-- Add bookmark
|
||||
reader.addBookmark(cfi);
|
||||
$bookmark
|
||||
.addClass("icon-bookmark")
|
||||
.removeClass("icon-bookmark-empty");
|
||||
} else { //-- Remove Bookmark
|
||||
reader.removeBookmark(cfi);
|
||||
$bookmark
|
||||
.removeClass("icon-bookmark")
|
||||
.addClass("icon-bookmark-empty");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
book.on('renderer:pageChanged', function(cfi){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue