1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

fixed error in removing marker

This commit is contained in:
fchasen 2014-02-19 15:35:36 -08:00
parent ed82dfe736
commit 4cf8bbc161
9 changed files with 72 additions and 33 deletions

View file

@ -403,6 +403,7 @@ EPUBJS.reader.ControlsController = function(book) {
});
book.on('renderer:locationChanged', function(cfi){
var cfiFragment = "#" + cfi;
//-- Check if bookmarked
var bookmarked = reader.isBookmarked(cfi);
if(bookmarked === -1) { //-- Not bookmarked
@ -416,8 +417,10 @@ EPUBJS.reader.ControlsController = function(book) {
}
// Update the History Location
if(reader.settings.history) {
history.pushState({}, '', "#"+cfi);
if(reader.settings.history &&
window.location.hash != cfiFragment) {
// Add CFI fragment to the history
history.pushState({}, '', cfiFragment);
}
});